(Android/GLES) Should work with HW render context again

This commit is contained in:
twinaphex 2016-08-03 00:08:50 +02:00
parent 5fc228fcfc
commit 23f4e8bdfa
2 changed files with 13 additions and 10 deletions

View File

@ -372,10 +372,12 @@ bool gl_check_capability(enum gl_capability_enum enum_idx)
#endif
break;
case GL_CAPS_FBO:
#ifdef HAVE_FBO
#ifdef HAVE_PSGL
#ifndef HAVE_FBO
break;
#else
#if defined(HAVE_PSGL) || defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES3) || defined(HAVE_OPENGLES_3_1) || defined(HAVE_OPENGLES_3_2)
return true;
#elif !defined(HAVE_OPENGLES2)
#else
if (!gl_query_core_context_in_use() && !gl_query_extension("ARB_framebuffer_object")
&& !gl_query_extension("EXT_framebuffer_object"))
return false;
@ -391,11 +393,8 @@ bool gl_check_capability(enum gl_capability_enum enum_idx)
&& glRenderbufferStorage
&& glDeleteRenderbuffers)
return true;
#else
return true;
#endif
#else
break;
#endif
#endif
case GL_CAPS_ARGB8:
#ifdef HAVE_OPENGLES
@ -420,8 +419,9 @@ bool gl_check_capability(enum gl_capability_enum enum_idx)
struct retro_hw_render_callback *hwr =
video_driver_get_hw_context();
if (hwr->stencil
&& gl_query_extension("OES_packed_depth_stencil"))
return true;
&& !gl_query_extension("OES_packed_depth_stencil"))
return false;
return true;
#else
/* TODO/FIXME - implement this for non-GLES? */
#endif

View File

@ -860,15 +860,18 @@ bool gl_init_hw_render(gl_t *gl, unsigned width, unsigned height)
if (!gl_check_capability(GL_CAPS_FBO))
return false;
RARCH_LOG("[GL]: Supports FBO (render-to-texture).\n");
glBindTexture(GL_TEXTURE_2D, 0);
glGenFramebuffers(gl->textures, gl->hw_render_fbo);
depth = hwr->depth;
stencil = hwr->stencil;
#ifdef HAVE_OPENGLES2
#ifdef HAVE_OPENGLES
if (!gl_check_capability(GL_CAPS_PACKED_DEPTH_STENCIL))
return false;
RARCH_LOG("[GL]: Supports Packed depth stencil.\n");
#endif
if (depth)