gl: Check for EXT_depth_bounds_test

Avoid glEnable/glDisable GL_DEPTH_BOUNDS_TEST_EXT flood that returns 
GL_INVALID_ENUM if the feature isn't supported
This commit is contained in:
Ani 2020-05-16 11:28:54 +01:00
commit 661636efef
2 changed files with 10 additions and 2 deletions

View file

@ -162,7 +162,7 @@ void GLGSRender::update_draw_state()
gl_state.depth_func(gl::comparison_op(rsx::method_registers.depth_func())); gl_state.depth_func(gl::comparison_op(rsx::method_registers.depth_func()));
} }
if (glDepthBoundsEXT && (gl_state.enable(rsx::method_registers.depth_bounds_test_enabled(), GL_DEPTH_BOUNDS_TEST_EXT))) if (gl::get_driver_caps().EXT_depth_bounds_test && (gl_state.enable(rsx::method_registers.depth_bounds_test_enabled(), GL_DEPTH_BOUNDS_TEST_EXT)))
{ {
gl_state.depth_bounds(rsx::method_registers.depth_bounds_min(), rsx::method_registers.depth_bounds_max()); gl_state.depth_bounds(rsx::method_registers.depth_bounds_min(), rsx::method_registers.depth_bounds_max());
} }

View file

@ -77,6 +77,7 @@ namespace gl
{ {
public: public:
bool EXT_dsa_supported = false; bool EXT_dsa_supported = false;
bool EXT_depth_bounds_test = false;
bool ARB_dsa_supported = false; bool ARB_dsa_supported = false;
bool ARB_buffer_storage_supported = false; bool ARB_buffer_storage_supported = false;
bool ARB_texture_buffer_supported = false; bool ARB_texture_buffer_supported = false;
@ -106,7 +107,7 @@ namespace gl
void initialize() void initialize()
{ {
int find_count = 11; int find_count = 12;
int ext_count = 0; int ext_count = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &ext_count); glGetIntegerv(GL_NUM_EXTENSIONS, &ext_count);
@ -192,6 +193,13 @@ namespace gl
find_count--; find_count--;
continue; continue;
} }
if (check(ext_name, "GL_EXT_depth_bounds_test"))
{
EXT_depth_bounds_test = true;
find_count--;
continue;
}
} }
// Workaround for intel drivers which have terrible capability reporting // Workaround for intel drivers which have terrible capability reporting