|
|
@ -31,6 +31,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept { |
|
|
.depth = config.block_depth, |
|
|
.depth = config.block_depth, |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
rescaleable = false; |
|
|
tile_width_spacing = config.tile_width_spacing; |
|
|
tile_width_spacing = config.tile_width_spacing; |
|
|
if (config.texture_type != TextureType::Texture2D && |
|
|
if (config.texture_type != TextureType::Texture2D && |
|
|
config.texture_type != TextureType::Texture2DNoMipmap) { |
|
|
config.texture_type != TextureType::Texture2DNoMipmap) { |
|
|
@ -53,12 +54,14 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept { |
|
|
case TextureType::Texture2DNoMipmap: |
|
|
case TextureType::Texture2DNoMipmap: |
|
|
ASSERT(config.Depth() == 1); |
|
|
ASSERT(config.Depth() == 1); |
|
|
type = config.IsPitchLinear() ? ImageType::Linear : ImageType::e2D; |
|
|
type = config.IsPitchLinear() ? ImageType::Linear : ImageType::e2D; |
|
|
|
|
|
rescaleable = !config.IsPitchLinear(); |
|
|
size.width = config.Width(); |
|
|
size.width = config.Width(); |
|
|
size.height = config.Height(); |
|
|
size.height = config.Height(); |
|
|
resources.layers = config.BaseLayer() + 1; |
|
|
resources.layers = config.BaseLayer() + 1; |
|
|
break; |
|
|
break; |
|
|
case TextureType::Texture2DArray: |
|
|
case TextureType::Texture2DArray: |
|
|
type = ImageType::e2D; |
|
|
type = ImageType::e2D; |
|
|
|
|
|
rescaleable = true; |
|
|
size.width = config.Width(); |
|
|
size.width = config.Width(); |
|
|
size.height = config.Height(); |
|
|
size.height = config.Height(); |
|
|
resources.layers = config.BaseLayer() + config.Depth(); |
|
|
resources.layers = config.BaseLayer() + config.Depth(); |
|
|
@ -98,12 +101,14 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept { |
|
|
// FIXME: Call this without passing *this
|
|
|
// FIXME: Call this without passing *this
|
|
|
layer_stride = CalculateLayerStride(*this); |
|
|
layer_stride = CalculateLayerStride(*this); |
|
|
maybe_unaligned_layer_stride = CalculateLayerSize(*this); |
|
|
maybe_unaligned_layer_stride = CalculateLayerSize(*this); |
|
|
|
|
|
rescaleable &= (block.depth == 0) && resources.levels == 1; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs, size_t index) noexcept { |
|
|
ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs, size_t index) noexcept { |
|
|
const auto& rt = regs.rt[index]; |
|
|
const auto& rt = regs.rt[index]; |
|
|
format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(rt.format); |
|
|
format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(rt.format); |
|
|
|
|
|
rescaleable = false; |
|
|
if (rt.tile_mode.is_pitch_linear) { |
|
|
if (rt.tile_mode.is_pitch_linear) { |
|
|
ASSERT(rt.tile_mode.is_3d == 0); |
|
|
ASSERT(rt.tile_mode.is_3d == 0); |
|
|
type = ImageType::Linear; |
|
|
type = ImageType::Linear; |
|
|
@ -129,6 +134,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs, size_t index) |
|
|
type = ImageType::e3D; |
|
|
type = ImageType::e3D; |
|
|
size.depth = rt.depth; |
|
|
size.depth = rt.depth; |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
rescaleable = block.depth == 0 && size.height > 256; |
|
|
type = ImageType::e2D; |
|
|
type = ImageType::e2D; |
|
|
resources.layers = rt.depth; |
|
|
resources.layers = rt.depth; |
|
|
} |
|
|
} |
|
|
@ -138,6 +144,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs) noexcept { |
|
|
format = VideoCore::Surface::PixelFormatFromDepthFormat(regs.zeta.format); |
|
|
format = VideoCore::Surface::PixelFormatFromDepthFormat(regs.zeta.format); |
|
|
size.width = regs.zeta_width; |
|
|
size.width = regs.zeta_width; |
|
|
size.height = regs.zeta_height; |
|
|
size.height = regs.zeta_height; |
|
|
|
|
|
rescaleable = false; |
|
|
resources.levels = 1; |
|
|
resources.levels = 1; |
|
|
layer_stride = regs.zeta.layer_stride * 4; |
|
|
layer_stride = regs.zeta.layer_stride * 4; |
|
|
maybe_unaligned_layer_stride = layer_stride; |
|
|
maybe_unaligned_layer_stride = layer_stride; |
|
|
@ -156,6 +163,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs) noexcept { |
|
|
type = ImageType::e3D; |
|
|
type = ImageType::e3D; |
|
|
size.depth = regs.zeta_depth; |
|
|
size.depth = regs.zeta_depth; |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
rescaleable = block.depth == 0 && size.height > 256; |
|
|
type = ImageType::e2D; |
|
|
type = ImageType::e2D; |
|
|
resources.layers = regs.zeta_depth; |
|
|
resources.layers = regs.zeta_depth; |
|
|
} |
|
|
} |
|
|
@ -164,6 +172,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs) noexcept { |
|
|
ImageInfo::ImageInfo(const Tegra::Engines::Fermi2D::Surface& config) noexcept { |
|
|
ImageInfo::ImageInfo(const Tegra::Engines::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; |
|
|
if (config.linear == Tegra::Engines::Fermi2D::MemoryLayout::Pitch) { |
|
|
if (config.linear == Tegra::Engines::Fermi2D::MemoryLayout::Pitch) { |
|
|
type = ImageType::Linear; |
|
|
type = ImageType::Linear; |
|
|
size = Extent3D{ |
|
|
size = Extent3D{ |
|
|
@ -174,6 +183,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Fermi2D::Surface& config) noexcept { |
|
|
pitch = config.pitch; |
|
|
pitch = config.pitch; |
|
|
} else { |
|
|
} else { |
|
|
type = config.block_depth > 0 ? ImageType::e3D : ImageType::e2D; |
|
|
type = config.block_depth > 0 ? ImageType::e3D : ImageType::e2D; |
|
|
|
|
|
|
|
|
block = Extent3D{ |
|
|
block = Extent3D{ |
|
|
.width = config.block_width, |
|
|
.width = config.block_width, |
|
|
.height = config.block_height, |
|
|
.height = config.block_height, |
|
|
@ -186,6 +196,7 @@ ImageInfo::ImageInfo(const Tegra::Engines::Fermi2D::Surface& config) noexcept { |
|
|
.height = config.height, |
|
|
.height = config.height, |
|
|
.depth = 1, |
|
|
.depth = 1, |
|
|
}; |
|
|
}; |
|
|
|
|
|
rescaleable = block.depth == 0 && size.height > 256; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|