From 19cf749944c422021bf26b0c390d1abd999d29db Mon Sep 17 00:00:00 2001 From: Jake Date: Wed, 2 Dec 2015 03:15:43 -0600 Subject: [PATCH] rsx: fix convert_linear_swizzle converting backwards --- rpcs3/Emu/RSX/Common/TextureUtils.cpp | 1 - rpcs3/Emu/RSX/RSXThread.h | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/TextureUtils.cpp b/rpcs3/Emu/RSX/Common/TextureUtils.cpp index dd7a681863..86a31f02e4 100644 --- a/rpcs3/Emu/RSX/Common/TextureUtils.cpp +++ b/rpcs3/Emu/RSX/Common/TextureUtils.cpp @@ -134,7 +134,6 @@ write16bTexelsSwizzled(const char *src, char *dst, size_t widthInBlock, size_t h Result.push_back(currentMipmapLevelInfo); u16 *castedSrc, *castedDst; - u16 log2width, log2height; castedSrc = (u16*)src + offsetInSrc; castedDst = (u16*)dst + offsetInDst; diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 260d9b097f..ee0add933f 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -121,7 +121,7 @@ namespace rsx extern u32 method_registers[0x10000 >> 2]; - u32 get_vertex_type_size(u32 type); + u32 get_vertex_type_size(u32 type); u32 get_address(u32 offset, u32 location); @@ -153,9 +153,9 @@ namespace rsx log2width = log2(width); log2height = log2(height); - // Max mask possible for square texture (should be 2^11, or 22 bits for x and y) - u32 x_mask = 0x555555; - u32 y_mask = 0xAAAAAA; + // Max mask possible for square texture + u32 x_mask = 0x55555555; + u32 y_mask = 0xAAAAAAAA; // We have to limit the masks to the lower of the two dimensions to allow for non-square textures u32 limitMask = (log2width < log2height) ? log2width : log2height; @@ -174,7 +174,7 @@ namespace rsx T *src, *dst; - if (inputIsSwizzled) { + if (!inputIsSwizzled) { for (int y = 0; y < height; ++y) { src = (T *)((T*)inputPixels + y*width); dst = (T *)((T*)outputPixels + offs_y);