From d04241ad25d62f5784fa3f5c4a195e82ba87cfad Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 25 Oct 2019 18:32:36 +0300 Subject: [PATCH] rsx: Allow compressed textures to be unaligned in size - Align based on row length but let the texture itself be of arbitrary dimensions --- rpcs3/Emu/RSX/Common/texture_cache.h | 4 +--- rpcs3/Emu/RSX/GL/GLTexture.cpp | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 939f98af6c..988082522c 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -1756,9 +1756,7 @@ namespace rsx if (options.is_compressed_format) { - attributes.width = align(attributes.width, 4); - attributes.height = align(attributes.height, 4); - + // Compressed textures cannot be 1D in some APIs extended_dimension = std::max(extended_dimension, rsx::texture_dimension_extended::texture_dimension_2d); } diff --git a/rpcs3/Emu/RSX/GL/GLTexture.cpp b/rpcs3/Emu/RSX/GL/GLTexture.cpp index d9701fccdd..94cd5c2b25 100644 --- a/rpcs3/Emu/RSX/GL/GLTexture.cpp +++ b/rpcs3/Emu/RSX/GL/GLTexture.cpp @@ -466,12 +466,9 @@ namespace gl if (LIKELY(is_compressed_format(format))) { - //Compressed formats have a 4-byte alignment - //TODO: Verify that samplers are not affected by the padding - width = align(width, 4); - height = align(height, 4); - caps.supports_vtc_decoding = gl::get_driver_caps().vendor_NVIDIA; + + unpack_settings.row_length(align(width, 4)); unpack_settings.apply(); for (const rsx_subresource_layout& layout : input_layouts)