From 649cbf5eb5bd9e56c5bab3fb52eec5c110e57645 Mon Sep 17 00:00:00 2001 From: Jean-Philip Desjardins Date: Thu, 4 Jun 2015 03:20:24 -0400 Subject: [PATCH] Fixed some paletted textures not showing up in GLES compatibility mode. --- Source/gs/GSH_OpenGL/GSH_OpenGL_Texture.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/gs/GSH_OpenGL/GSH_OpenGL_Texture.cpp b/Source/gs/GSH_OpenGL/GSH_OpenGL_Texture.cpp index b7caec69..566eb05e 100644 --- a/Source/gs/GSH_OpenGL/GSH_OpenGL_Texture.cpp +++ b/Source/gs/GSH_OpenGL/GSH_OpenGL_Texture.cpp @@ -362,7 +362,12 @@ void CGSH_OpenGL::TexUploader_Psm48H(uint32 bufPtr, uint32 bufWidth, unsigned in dst += texWidth; } +#ifdef GLES_COMPATIBILITY + //GL_ALPHA isn't allowed in GL 3.2+ + glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, texWidth, texHeight, 0, GL_RED, GL_UNSIGNED_BYTE, m_pCvtBuffer); +#else glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, texWidth, texHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, m_pCvtBuffer); +#endif } void CGSH_OpenGL::TexUpdater_Invalid(uint32 bufPtr, uint32 bufWidth, unsigned int texX, unsigned int texY, unsigned int texWidth, unsigned int texHeight) @@ -452,7 +457,12 @@ void CGSH_OpenGL::TexUpdater_Psm48H(uint32 bufPtr, uint32 bufWidth, unsigned int dst += texWidth; } +#ifdef GLES_COMPATIBILITY + //GL_ALPHA isn't allowed in GL 3.2+ + glTexSubImage2D(GL_TEXTURE_2D, 0, texX, texY, texWidth, texHeight, GL_RED, GL_UNSIGNED_BYTE, m_pCvtBuffer); +#else glTexSubImage2D(GL_TEXTURE_2D, 0, texX, texY, texWidth, texHeight, GL_ALPHA, GL_UNSIGNED_BYTE, m_pCvtBuffer); +#endif } /////////////////////////////////////////////////////////////