From 8a3d15d4fed3498cd1ff697f77daa14ea10071f2 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 24 Feb 2016 14:50:02 +0300 Subject: [PATCH] Handle swizzled CELL_GCM_B8 textures Properly handle swizzled single-channel textures --- rpcs3/Emu/RSX/Common/TextureUtils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Common/TextureUtils.cpp b/rpcs3/Emu/RSX/Common/TextureUtils.cpp index 1e85c90206..6b1e2dba87 100644 --- a/rpcs3/Emu/RSX/Common/TextureUtils.cpp +++ b/rpcs3/Emu/RSX/Common/TextureUtils.cpp @@ -291,7 +291,10 @@ std::vector upload_placed_texture(gsl::span mapped_b else return copy_texture_data(as_span_workaround(mapped_buffer), reinterpret_cast(pixels), w, h, depth, layer, texture.mipmap(), texture.pitch()); case CELL_GCM_TEXTURE_B8: - return copy_texture_data(as_span_workaround(mapped_buffer), reinterpret_cast(pixels), w, h, depth, layer, texture.mipmap(), texture.pitch()); + if (is_swizzled) + return copy_texture_data(as_span_workaround(mapped_buffer), reinterpret_cast(pixels), w, h, depth, layer, texture.mipmap(), texture.pitch()); + else + return copy_texture_data(as_span_workaround(mapped_buffer), reinterpret_cast(pixels), w, h, depth, layer, texture.mipmap(), texture.pitch()); } throw EXCEPTION("Wrong format %d", format); }