Use correct arguments if sRGB and GLES3.

This commit is contained in:
Themaister 2014-06-05 17:41:10 +02:00
parent 2094e8fb2f
commit ba40be9099
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View File

@ -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;