From de3c1a04dba8190260fd325384ce8b3dcd89dbd4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 31 Oct 2016 15:24:03 +0100 Subject: [PATCH] Simplifications --- .../gl_renderchains/render_chain_gl_legacy.c | 3 +- libretro-common/gfx/gl_capabilities.c | 34 ++++--------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c b/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c index b2df6fa4d0..5858673a72 100644 --- a/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c +++ b/gfx/drivers/gl_renderchains/render_chain_gl_legacy.c @@ -871,7 +871,8 @@ bool gl_init_hw_render(gl_t *gl, unsigned width, unsigned height) stencil = hwr->stencil; #ifdef HAVE_OPENGLES - if (!gl_check_capability(GL_CAPS_PACKED_DEPTH_STENCIL)) + if (!hwr->stencil && + !gl_check_capability(GL_CAPS_PACKED_DEPTH_STENCIL)) return false; RARCH_LOG("[GL]: Supports Packed depth stencil.\n"); #endif diff --git a/libretro-common/gfx/gl_capabilities.c b/libretro-common/gfx/gl_capabilities.c index d62bfa691d..8f47d52372 100644 --- a/libretro-common/gfx/gl_capabilities.c +++ b/libretro-common/gfx/gl_capabilities.c @@ -31,10 +31,6 @@ #include -#ifdef RARCH_INTERNAL -#include "../../gfx/video_driver.h" -#endif - static bool gl_core_context = false; bool gl_query_core_context_in_use(void) @@ -52,19 +48,6 @@ void gl_query_core_context_unset(void) gl_core_context = false; } -static bool has_hardware_stencil(void) -{ -#ifdef RARCH_INTERNAL - struct retro_hw_render_callback *hwr = - video_driver_get_hw_context(); - if (!hwr) - return false; - return hwr->stencil; -#else - return true; -#endif -} - static bool gl_query_extension(const char *ext) { bool ret = false; @@ -227,16 +210,13 @@ bool gl_check_capability(enum gl_capability_enum enum_idx) #endif break; case GL_CAPS_PACKED_DEPTH_STENCIL: - { - if (!has_hardware_stencil()) - return false; - if (major >= 3) - return true; - if ( !gl_query_extension("OES_packed_depth_stencil") - && !gl_query_extension("EXT_packed_depth_stencil")) - return false; - } - return true; + if (major >= 3) + return true; + if (gl_query_extension("OES_packed_depth_stencil")) + return true; + if (gl_query_extension("EXT_packed_depth_stencil")) + return true; + break; case GL_CAPS_ES2_COMPAT: #ifndef HAVE_OPENGLES /* ATI card detected, skipping check for GL_RGB565 support... */