From ba40be909913c9ccc34dab5d452fba4fe61af9d0 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 5 Jun 2014 17:41:10 +0200 Subject: [PATCH] Use correct arguments if sRGB and GLES3. --- gfx/gl.c | 6 +++++- gfx/gl_common.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gfx/gl.c b/gfx/gl.c index 8be87c786e..ac3a775e24 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -539,10 +539,13 @@ static void gl_create_fbo_textures(void *data) { RARCH_LOG("[GL]: FBO pass #%d is sRGB.\n", i); #ifdef HAVE_OPENGLES2 + // EXT defines are same as core GLES3 defines, but GLES3 variant requires different + // arguments ... glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB_ALPHA_EXT, gl->fbo_rect[i].width, gl->fbo_rect[i].height, 0, - GL_SRGB_ALPHA_EXT, GL_UNSIGNED_BYTE, NULL); + gl->has_srgb_fbo_gles3 ? GL_RGBA : GL_SRGB_ALPHA_EXT, + GL_UNSIGNED_BYTE, NULL); #else glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB8_ALPHA8, @@ -1878,6 +1881,7 @@ static bool resolve_extensions(gl_t *gl) } // No extensions for float FBO currently. gl->has_srgb_fbo = gles3 || gl_query_extension(gl, "EXT_sRGB"); + gl->has_srgb_fbo_gles3 = gles3; #else #ifdef HAVE_FBO // Float FBO is core in 3.2. diff --git a/gfx/gl_common.h b/gfx/gl_common.h index b67dc8d5c1..fa40a083a8 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -240,6 +240,7 @@ typedef struct gl bool hw_render_depth_init; bool has_fp_fbo; bool has_srgb_fbo; + bool has_srgb_fbo_gles3; #endif bool hw_render_use; bool shared_context_use;