video_core: Keep the definition of DimensionControl consistent with nvidia open doc
This commit is contained in:
parent
11ffbee5ae
commit
ff2089fdf5
2 changed files with 22 additions and 19 deletions
|
@ -856,8 +856,8 @@ public:
|
||||||
|
|
||||||
struct ZetaSize {
|
struct ZetaSize {
|
||||||
enum class DimensionControl : u32 {
|
enum class DimensionControl : u32 {
|
||||||
DepthDefinesArray = 0,
|
DefineArraySize = 0,
|
||||||
ArraySizeOne = 1,
|
ArraySizeIsOne = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
u32 width;
|
u32 width;
|
||||||
|
@ -1104,8 +1104,8 @@ public:
|
||||||
|
|
||||||
struct TileMode {
|
struct TileMode {
|
||||||
enum class DimensionControl : u32 {
|
enum class DimensionControl : u32 {
|
||||||
DepthDefinesArray = 0,
|
DefineArraySize = 0,
|
||||||
DepthDefinesDepth = 1,
|
DefineDepthSize = 1,
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
BitField<0, 4, u32> block_width;
|
BitField<0, 4, u32> block_width;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
namespace VideoCommon {
|
namespace VideoCommon {
|
||||||
|
|
||||||
|
using Tegra::Engines::Fermi2D;
|
||||||
using Tegra::Engines::Maxwell3D;
|
using Tegra::Engines::Maxwell3D;
|
||||||
using Tegra::Texture::TextureType;
|
using Tegra::Texture::TextureType;
|
||||||
using Tegra::Texture::TICEntry;
|
using Tegra::Texture::TICEntry;
|
||||||
|
@ -114,13 +115,13 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs::RenderTargetConfig& ct,
|
ImageInfo::ImageInfo(const Maxwell3D::Regs::RenderTargetConfig& ct,
|
||||||
Tegra::Texture::MsaaMode msaa_mode) noexcept {
|
Tegra::Texture::MsaaMode msaa_mode) noexcept {
|
||||||
format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(ct.format);
|
format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(ct.format);
|
||||||
rescaleable = false;
|
rescaleable = false;
|
||||||
if (ct.tile_mode.is_pitch_linear) {
|
if (ct.tile_mode.is_pitch_linear) {
|
||||||
ASSERT(ct.tile_mode.dim_control ==
|
ASSERT(ct.tile_mode.dim_control ==
|
||||||
Maxwell3D::Regs::TileMode::DimensionControl::DepthDefinesArray);
|
Maxwell3D::Regs::TileMode::DimensionControl::DefineArraySize);
|
||||||
type = ImageType::Linear;
|
type = ImageType::Linear;
|
||||||
pitch = ct.width;
|
pitch = ct.width;
|
||||||
size = Extent3D{
|
size = Extent3D{
|
||||||
|
@ -140,8 +141,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs::RenderTargetConfig&
|
||||||
.height = ct.tile_mode.block_height,
|
.height = ct.tile_mode.block_height,
|
||||||
.depth = ct.tile_mode.block_depth,
|
.depth = ct.tile_mode.block_depth,
|
||||||
};
|
};
|
||||||
if (ct.tile_mode.dim_control ==
|
if (ct.tile_mode.dim_control == Maxwell3D::Regs::TileMode::DimensionControl::DefineDepthSize) {
|
||||||
Maxwell3D::Regs::TileMode::DimensionControl::DepthDefinesDepth) {
|
|
||||||
type = ImageType::e3D;
|
type = ImageType::e3D;
|
||||||
size.depth = ct.depth;
|
size.depth = ct.depth;
|
||||||
} else {
|
} else {
|
||||||
|
@ -153,8 +153,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs::RenderTargetConfig&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs::Zeta& zt,
|
ImageInfo::ImageInfo(const Maxwell3D::Regs::Zeta& zt, const Maxwell3D::Regs::ZetaSize& zt_size,
|
||||||
const Tegra::Engines::Maxwell3D::Regs::ZetaSize& zt_size,
|
|
||||||
Tegra::Texture::MsaaMode msaa_mode) noexcept {
|
Tegra::Texture::MsaaMode msaa_mode) noexcept {
|
||||||
format = VideoCore::Surface::PixelFormatFromDepthFormat(zt.format);
|
format = VideoCore::Surface::PixelFormatFromDepthFormat(zt.format);
|
||||||
size.width = zt_size.width;
|
size.width = zt_size.width;
|
||||||
|
@ -171,30 +170,34 @@ ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs::Zeta& zt,
|
||||||
};
|
};
|
||||||
if (zt.tile_mode.is_pitch_linear) {
|
if (zt.tile_mode.is_pitch_linear) {
|
||||||
ASSERT(zt.tile_mode.dim_control ==
|
ASSERT(zt.tile_mode.dim_control ==
|
||||||
Maxwell3D::Regs::TileMode::DimensionControl::DepthDefinesArray);
|
Maxwell3D::Regs::TileMode::DimensionControl::DefineArraySize);
|
||||||
type = ImageType::Linear;
|
type = ImageType::Linear;
|
||||||
pitch = size.width * BytesPerBlock(format);
|
pitch = size.width * BytesPerBlock(format);
|
||||||
} else if (zt.tile_mode.dim_control ==
|
} else if (zt.tile_mode.dim_control ==
|
||||||
Maxwell3D::Regs::TileMode::DimensionControl::DepthDefinesDepth) {
|
Maxwell3D::Regs::TileMode::DimensionControl::DefineDepthSize) {
|
||||||
ASSERT(zt.tile_mode.is_pitch_linear == 0);
|
ASSERT(zt_size.dim_control == Maxwell3D::Regs::ZetaSize::DimensionControl::ArraySizeIsOne);
|
||||||
ASSERT(zt_size.dim_control == Maxwell3D::Regs::ZetaSize::DimensionControl::ArraySizeOne);
|
|
||||||
type = ImageType::e3D;
|
type = ImageType::e3D;
|
||||||
size.depth = zt_size.depth;
|
size.depth = zt_size.depth;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(zt_size.dim_control ==
|
|
||||||
Maxwell3D::Regs::ZetaSize::DimensionControl::DepthDefinesArray);
|
|
||||||
rescaleable = block.depth == 0;
|
rescaleable = block.depth == 0;
|
||||||
downscaleable = size.height > 512;
|
downscaleable = size.height > 512;
|
||||||
type = ImageType::e2D;
|
type = ImageType::e2D;
|
||||||
|
switch (zt_size.dim_control) {
|
||||||
|
case Maxwell3D::Regs::ZetaSize::DimensionControl::DefineArraySize:
|
||||||
resources.layers = zt_size.depth;
|
resources.layers = zt_size.depth;
|
||||||
|
break;
|
||||||
|
case Maxwell3D::Regs::ZetaSize::DimensionControl::ArraySizeIsOne:
|
||||||
|
resources.layers = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageInfo::ImageInfo(const Tegra::Engines::Fermi2D::Surface& config) noexcept {
|
ImageInfo::ImageInfo(const Fermi2D::Surface& config) noexcept {
|
||||||
UNIMPLEMENTED_IF_MSG(config.layer != 0, "Surface layer is not zero");
|
UNIMPLEMENTED_IF_MSG(config.layer != 0, "Surface layer is not zero");
|
||||||
format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(config.format);
|
format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(config.format);
|
||||||
rescaleable = false;
|
rescaleable = false;
|
||||||
if (config.linear == Tegra::Engines::Fermi2D::MemoryLayout::Pitch) {
|
if (config.linear == Fermi2D::MemoryLayout::Pitch) {
|
||||||
type = ImageType::Linear;
|
type = ImageType::Linear;
|
||||||
size = Extent3D{
|
size = Extent3D{
|
||||||
.width = config.pitch / VideoCore::Surface::BytesPerBlock(format),
|
.width = config.pitch / VideoCore::Surface::BytesPerBlock(format),
|
||||||
|
|
Loading…
Reference in a new issue