From 5b0ef401f7f2518c295c1a6496335385e98aafc9 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sat, 30 Oct 2021 14:22:56 +0300 Subject: [PATCH] rsx: Fix sampling in X when 0 pitch is given - A pitch of 0 still allows 1-dimensional addressing. --- rpcs3/Emu/RSX/Common/TextureUtils.cpp | 4 ++-- rpcs3/Emu/RSX/Common/texture_cache.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/TextureUtils.cpp b/rpcs3/Emu/RSX/Common/TextureUtils.cpp index 967bc81a9b..09a52faffb 100644 --- a/rpcs3/Emu/RSX/Common/TextureUtils.cpp +++ b/rpcs3/Emu/RSX/Common/TextureUtils.cpp @@ -580,7 +580,7 @@ std::vector get_subresources_layout_impl(const RsxTextu } else { - w = h = depth = 1; + h = depth = 1; } } @@ -1161,7 +1161,7 @@ namespace rsx if (width > 1 || height > 1) { // If width == 1, the scanning just returns texel 0, so it is a valid setup - rsx_log.error("Invalid texture pitch setup, width=%d, height=%d, format=0x%x(0x%x)", + rsx_log.warning("Invalid texture pitch setup, width=%d, height=%d, format=0x%x(0x%x)", width, height, format, gcm_format); } diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 03ebf65ae8..5b426c7b3c 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -2031,7 +2031,7 @@ namespace rsx if (attributes.pitch = tex.pitch(); !attributes.pitch) { attributes.pitch = packed_pitch; - scale = { 0.f, 0.f, 0.f }; + scale = { 1.f, 0.f, 0.f }; } else if (packed_pitch > attributes.pitch && !options.is_compressed_format) {