mirror of
https://github.com/libretro/RetroArch.git
synced 2024-12-14 04:41:34 +00:00
Start making gl_capabilities.c more usable by libretro-common
This commit is contained in:
parent
3702fde113
commit
e512065d7d
@ -23,7 +23,10 @@
|
||||
#include <boolean.h>
|
||||
|
||||
#include "gl_capabilities.h"
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "../video_driver.h"
|
||||
#endif
|
||||
|
||||
static bool gl_core_context = false;
|
||||
|
||||
@ -42,6 +45,19 @@ 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;
|
||||
@ -205,12 +221,11 @@ bool gl_check_capability(enum gl_capability_enum enum_idx)
|
||||
break;
|
||||
case GL_CAPS_PACKED_DEPTH_STENCIL:
|
||||
{
|
||||
struct retro_hw_render_callback *hwr =
|
||||
video_driver_get_hw_context();
|
||||
if (!has_hardware_stencil())
|
||||
return false;
|
||||
if (major >= 3)
|
||||
return true;
|
||||
if (hwr->stencil
|
||||
&& !gl_query_extension("OES_packed_depth_stencil")
|
||||
if ( !gl_query_extension("OES_packed_depth_stencil")
|
||||
&& !gl_query_extension("EXT_packed_depth_stencil"))
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user