Browse Source

Normalize 2D TICs to 2DArray or 3D according to configuration

pull/2830/head
MaranBr 5 months ago
committed by crueter
parent
commit
f65b946214
  1. 10
      src/video_core/texture_cache/image_info.cpp
  2. 10
      src/video_core/texture_cache/image_view_info.cpp

10
src/video_core/texture_cache/image_info.cpp

@ -52,9 +52,17 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
ASSERT(!config.IsPitchLinear());
}
TextureType tex_type = config.texture_type;
if (tex_type == TextureType::Texture1D && (config.Depth() > 1 || config.BaseLayer() != 0)) {
if (tex_type == TextureType::Texture1D) {
if (config.Depth() > 1 || config.BaseLayer() != 0) {
tex_type = TextureType::Texture1DArray;
}
} else if (tex_type == TextureType::Texture2D) {
if (config.Depth() > 1) {
tex_type = TextureType::Texture3D;
} else if (config.BaseLayer() != 0) {
tex_type = TextureType::Texture2DArray;
}
}
switch (tex_type) {
case TextureType::Texture1D:
ASSERT(config.BaseLayer() == 0);

10
src/video_core/texture_cache/image_view_info.cpp

@ -41,9 +41,17 @@ ImageViewInfo::ImageViewInfo(const TICEntry& config, s32 base_layer) noexcept
};
range.extent.levels = config.res_max_mip_level - config.res_min_mip_level + 1;
TextureType tex_type = config.texture_type;
if (tex_type == TextureType::Texture1D && (config.Depth() > 1 || base_layer != 0)) {
if (tex_type == TextureType::Texture1D) {
if (config.Depth() > 1 || base_layer != 0) {
tex_type = TextureType::Texture1DArray;
}
} else if (tex_type == TextureType::Texture2D) {
if (config.Depth() > 1) {
tex_type = TextureType::Texture3D;
} else if (base_layer != 0) {
tex_type = TextureType::Texture2DArray;
}
}
switch (tex_type) {
case TextureType::Texture1D:
ASSERT(config.Height() == 1);

Loading…
Cancel
Save