Make sure enable bits in GL render state are properly extension guarded

This commit is contained in:
baldurk
2017-01-13 15:58:33 +00:00
parent 07df2cc37c
commit 69bb551f22
2 changed files with 12 additions and 2 deletions
+2 -1
View File
@@ -211,7 +211,8 @@ extern bool GLIsCore;
EXT_TO_CHECK(ARB_explicit_attrib_location) \
EXT_TO_CHECK(ARB_vertex_attrib_binding) \
EXT_TO_CHECK(ARB_sampler_objects) \
EXT_TO_CHECK(KHR_debug)
EXT_TO_CHECK(KHR_debug) \
EXT_TO_CHECK(ARB_sample_shading)
// extensions we know we want to check for are precached, indexd by this enum
enum ExtensionCheckEnum
+10 -1
View File
@@ -584,6 +584,12 @@ void GLRenderState::FetchState(void *ctx, WrappedOpenGL *gl)
continue;
}
if(pnames[i] == eGL_SAMPLE_SHADING && !ExtensionSupported[GLExt_ARB_sample_shading])
{
Enabled[i] = false;
continue;
}
Enabled[i] = (m_Real->glIsEnabled(pnames[i]) == GL_TRUE);
}
}
@@ -957,6 +963,9 @@ void GLRenderState::ApplyState(void *ctx, WrappedOpenGL *gl)
if(pnames[i] == eGL_DEPTH_BOUNDS_TEST_EXT && !ExtensionSupported[GLExt_EXT_depth_bounds_test])
continue;
if(pnames[i] == eGL_SAMPLE_SHADING && !ExtensionSupported[GLExt_ARB_sample_shading])
continue;
if(Enabled[i])
m_Real->glEnable(pnames[i]);
else
@@ -1168,7 +1177,7 @@ void GLRenderState::ApplyState(void *ctx, WrappedOpenGL *gl)
m_Real->glDepthRangeArrayv(i, 1, v);
}
if(m_Real->glDepthBoundsEXT) // extension, not always available
if(ExtensionSupported[GLExt_EXT_depth_bounds_test] && m_Real->glDepthBoundsEXT)
m_Real->glDepthBoundsEXT(DepthBounds.nearZ, DepthBounds.farZ);
{