From 404073c74aba4c979d93de6bb422d218a1015bbb Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 18 Oct 2019 00:21:09 +0300 Subject: [PATCH] rsx: Force-align compressed formats to 4x4 texel blocks and disable 1D compressed textures. - The PS3 allows defining 1D compressed images but this obviously doesn't work well on desktop. --- rpcs3/Emu/RSX/Common/texture_cache.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index db51e54fd1..b2c14b957b 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -1722,7 +1722,7 @@ namespace rsx const bool is_unnormalized = !!(tex.format() & CELL_GCM_TEXTURE_UN); const bool is_swizzled = !(tex.format() & CELL_GCM_TEXTURE_LN); - const auto extended_dimension = tex.get_extended_texture_dimension(); + auto extended_dimension = tex.get_extended_texture_dimension(); options.is_compressed_format = texture_cache_helpers::is_compressed_gcm_format(attributes.gcm_format); @@ -1786,6 +1786,14 @@ namespace rsx } } + if (options.is_compressed_format) + { + attributes.width = align(attributes.width, 4); + attributes.height = align(attributes.height, 4); + + extended_dimension = std::max(extended_dimension, rsx::texture_dimension_extended::texture_dimension_2d); + } + const auto lookup_range = utils::address_range::start_length(attributes.address, attributes.pitch * required_surface_height); reader_lock lock(m_cache_mutex);