From 09ea570dcbd2882a444f24982eea7e3881a2ce43 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 1 Aug 2016 17:33:50 +0200 Subject: [PATCH] Create GL_CAPS_FP_FBO --- gfx/common/gl_common.h | 2 +- gfx/drivers/gl.c | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gfx/common/gl_common.h b/gfx/common/gl_common.h index 188df76ca9..382f7757fe 100644 --- a/gfx/common/gl_common.h +++ b/gfx/common/gl_common.h @@ -210,9 +210,9 @@ typedef struct gl GLuint hw_render_depth[GFX_MAX_TEXTURES]; bool hw_render_fbo_init; bool hw_render_depth_init; - bool has_fp_fbo; bool has_srgb_fbo_gles3; #endif + bool has_fp_fbo; bool has_srgb_fbo; bool hw_render_use; diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 17c1af3ad2..e59ef05080 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -321,7 +321,8 @@ enum gl_capability_enum GL_CAPS_ES2_COMPAT, GL_CAPS_UNPACK_ROW_LENGTH, GL_CAPS_FULL_NPOT_SUPPORT, - GL_CAPS_SRGB_FBO + GL_CAPS_SRGB_FBO, + GL_CAPS_FP_FBO }; static bool gl_check_capability(enum gl_capability_enum enum_idx) @@ -513,6 +514,15 @@ static bool gl_check_capability(enum gl_capability_enum enum_idx) && gl_query_extension("ARB_framebuffer_sRGB"))) return true; #endif +#endif + break; + case GL_CAPS_FP_FBO: +#ifndef HAVE_OPENGLES +#ifdef HAVE_FBO + /* Float FBO is core in 3.2. */ + if (gl_core_context || gl_query_extension("ARB_texture_float")) + return true; +#endif #endif break; case GL_CAPS_NONE: @@ -2499,13 +2509,9 @@ static bool resolve_extensions(gl_t *gl, const char *context_ident) /* No extensions for float FBO currently. */ gl->has_srgb_fbo_gles3 = gles3; -#else -#ifdef HAVE_FBO - /* Float FBO is core in 3.2. */ - gl->has_fp_fbo = gl_core_context || gl_query_extension("ARB_texture_float"); -#endif #endif + gl->has_fp_fbo = gl_check_capability(GL_CAPS_FP_FBO); gl->has_srgb_fbo = gl_check_capability(GL_CAPS_SRGB_FBO); #ifdef HAVE_FBO