mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-23 15:40:34 +00:00
rsx: Downgrade depth-1 3D images to 2D (#11593)
- Fixes problems with implicit view types derived from dimensions.
This commit is contained in:
parent
a8e62e1bc1
commit
6c096b72b5
@ -2092,20 +2092,6 @@ namespace rsx
|
|||||||
|
|
||||||
switch (extended_dimension)
|
switch (extended_dimension)
|
||||||
{
|
{
|
||||||
case rsx::texture_dimension_extended::texture_dimension_1d:
|
|
||||||
attributes.depth = 1;
|
|
||||||
attributes.height = 1;
|
|
||||||
attributes.slice_h = 1;
|
|
||||||
scale.height = scale.depth = 0.f;
|
|
||||||
subsurface_count = 1;
|
|
||||||
required_surface_height = 1;
|
|
||||||
break;
|
|
||||||
case rsx::texture_dimension_extended::texture_dimension_2d:
|
|
||||||
attributes.depth = 1;
|
|
||||||
scale.depth = 0.f;
|
|
||||||
subsurface_count = options.is_compressed_format? 1 : tex.get_exact_mipmap_count();
|
|
||||||
attributes.slice_h = required_surface_height = attributes.height;
|
|
||||||
break;
|
|
||||||
case rsx::texture_dimension_extended::texture_dimension_cubemap:
|
case rsx::texture_dimension_extended::texture_dimension_cubemap:
|
||||||
attributes.depth = 6;
|
attributes.depth = 6;
|
||||||
subsurface_count = 1;
|
subsurface_count = 1;
|
||||||
@ -2115,10 +2101,30 @@ namespace rsx
|
|||||||
break;
|
break;
|
||||||
case rsx::texture_dimension_extended::texture_dimension_3d:
|
case rsx::texture_dimension_extended::texture_dimension_3d:
|
||||||
attributes.depth = tex.depth();
|
attributes.depth = tex.depth();
|
||||||
|
if (attributes.depth > 1)
|
||||||
|
{
|
||||||
|
subsurface_count = 1;
|
||||||
|
tex_size = static_cast<u32>(get_texture_size(tex));
|
||||||
|
required_surface_height = tex_size / attributes.pitch;
|
||||||
|
attributes.slice_h = required_surface_height / attributes.depth;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Downgrade to 2D
|
||||||
|
extended_dimension = rsx::texture_dimension_extended::texture_dimension_2d;
|
||||||
|
[[ fallthrough ]];
|
||||||
|
case rsx::texture_dimension_extended::texture_dimension_2d:
|
||||||
|
attributes.depth = 1;
|
||||||
|
scale.depth = 0.f;
|
||||||
|
subsurface_count = options.is_compressed_format? 1 : tex.get_exact_mipmap_count();
|
||||||
|
attributes.slice_h = required_surface_height = attributes.height;
|
||||||
|
break;
|
||||||
|
case rsx::texture_dimension_extended::texture_dimension_1d:
|
||||||
|
attributes.depth = 1;
|
||||||
|
attributes.height = 1;
|
||||||
|
attributes.slice_h = 1;
|
||||||
|
scale.height = scale.depth = 0.f;
|
||||||
subsurface_count = 1;
|
subsurface_count = 1;
|
||||||
tex_size = static_cast<u32>(get_texture_size(tex));
|
required_surface_height = 1;
|
||||||
required_surface_height = tex_size / attributes.pitch;
|
|
||||||
attributes.slice_h = required_surface_height / attributes.depth;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fmt::throw_exception("Unsupported texture dimension %d", static_cast<int>(extended_dimension));
|
fmt::throw_exception("Unsupported texture dimension %d", static_cast<int>(extended_dimension));
|
||||||
|
@ -24,6 +24,7 @@ namespace vk
|
|||||||
dim_limit = (info.flags == VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) ? gpu_limits.maxImageDimensionCube : gpu_limits.maxImageDimension2D;
|
dim_limit = (info.flags == VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) ? gpu_limits.maxImageDimensionCube : gpu_limits.maxImageDimension2D;
|
||||||
break;
|
break;
|
||||||
case VK_IMAGE_TYPE_3D:
|
case VK_IMAGE_TYPE_3D:
|
||||||
|
ensure(info.extent.depth > 1);
|
||||||
longest_dim = std::max({ info.extent.width, info.extent.height, info.extent.depth });
|
longest_dim = std::max({ info.extent.width, info.extent.height, info.extent.depth });
|
||||||
dim_limit = gpu_limits.maxImageDimension3D;
|
dim_limit = gpu_limits.maxImageDimension3D;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user