Merge pull request #16182 from unknownbrackets/gles-indexed

GLES: Use GL_LUMINANCE on GLES for indexed tex
This commit is contained in:
Henrik Rydgård 2022-10-09 10:19:26 +02:00 committed by GitHub
commit 10fedf19bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 14 deletions

View file

@ -398,15 +398,3 @@ public:
#undef STATE2
extern DirectXState dxstate;
struct GLExtensions {
bool OES_depth24;
bool OES_packed_depth_stencil;
bool OES_depth_texture;
bool EXT_discard_framebuffer;
bool FBO_ARB;
};
extern GLExtensions gl_extensions;
void CheckGLExtensions();

View file

@ -1,4 +1,5 @@
#include "Common/GPU/OpenGL/DataFormatGL.h"
#include "Common/GPU/OpenGL/GLFeatures.h"
#include "Common/Log.h"
namespace Draw {
@ -15,8 +16,16 @@ bool Thin3DFormatToGLFormatAndType(DataFormat fmt, GLuint &internalFormat, GLuin
break;
case DataFormat::R8_UNORM:
internalFormat = GL_RGBA;
format = GL_RED;
if (gl_extensions.IsGLES) {
internalFormat = GL_LUMINANCE;
format = GL_LUMINANCE;
} else if (gl_extensions.VersionGEThan(3, 0)) {
internalFormat = GL_RED;
format = GL_RED;
} else {
internalFormat = GL_RGBA;
format = GL_RED;
}
type = GL_UNSIGNED_BYTE;
alignment = 1;
break;