From 7992115f6cee23cd343bfaf8d347e4798d7b261f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 17 May 2014 23:06:26 -0700 Subject: [PATCH 1/2] GL: Swap R/B in A1R5G5B5 correctly. Fixes Terraria, thanks @raven02. How did I miss this, it was not passing the test after all... --- rpcs3/Emu/GS/GL/GLGSRender.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/GS/GL/GLGSRender.h b/rpcs3/Emu/GS/GL/GLGSRender.h index 8f73f09ead..9c850f9805 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.h +++ b/rpcs3/Emu/GS/GL/GLGSRender.h @@ -121,7 +121,7 @@ public: checkForGlError("GLTexture::Init() -> glPixelStorei"); // TODO: texture swizzling - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels); checkForGlError("GLTexture::Init() -> glTexImage2D"); glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); From 07505aa9e20ccdd50008b7394135555aa44be6e5 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 17 May 2014 23:14:42 -0700 Subject: [PATCH 2/2] GL: Fix D1R5G5B5 texture R/B components as well. --- rpcs3/Emu/GS/GL/GLGSRender.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/GS/GL/GLGSRender.h b/rpcs3/Emu/GS/GL/GLGSRender.h index 9c850f9805..1cb8869ab2 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.h +++ b/rpcs3/Emu/GS/GL/GLGSRender.h @@ -313,7 +313,7 @@ public: checkForGlError("GLTexture::Init() -> glPixelStorei"); // TODO: Texture swizzling - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels); checkForGlError("GLTexture::Init() -> glTexImage2D"); static const GLint swizzleMaskX32_D1R5G5B5[] = { GL_ONE, GL_RED, GL_GREEN, GL_BLUE };