Disable depth bounds test when rendering GL overlay

This commit is contained in:
baldurk
2022-06-17 17:27:30 +01:00
parent fd2ae37a8b
commit 46a1f90495
3 changed files with 30 additions and 1 deletions
+26
View File
@@ -880,6 +880,9 @@ void GLPushPopState::Push(bool modern)
if(HasExt[EXT_transform_feedback])
enableBits[6] = GL.glIsEnabled(eGL_RASTERIZER_DISCARD) != 0;
if(HasExt[EXT_depth_bounds_test])
enableBits[8] = GL.glIsEnabled(eGL_DEPTH_BOUNDS_TEST_EXT) != 0;
}
else
{
@@ -933,6 +936,16 @@ void GLPushPopState::Push(bool modern)
GL.glGetBooleanv(eGL_COLOR_WRITEMASK, ColorMask);
}
if(modern && HasExt[EXT_depth_bounds_test])
{
GL.glGetDoublev(eGL_DEPTH_BOUNDS_EXT, bounds);
}
else
{
bounds[0] = 0.0;
bounds[1] = 1.0;
}
if(!VendorCheck[VendorCheck_AMD_polygon_mode_query] && !IsGLES)
{
GLenum dummy[2] = {eGL_FILL, eGL_FILL};
@@ -1051,6 +1064,14 @@ void GLPushPopState::Pop(bool modern)
else
GL.glDisable(eGL_RASTERIZER_DISCARD);
}
if(HasExt[EXT_depth_bounds_test])
{
if(enableBits[8])
GL.glEnable(eGL_DEPTH_BOUNDS_TEST_EXT);
else
GL.glDisable(eGL_DEPTH_BOUNDS_TEST_EXT);
}
}
else
{
@@ -1099,6 +1120,11 @@ void GLPushPopState::Pop(bool modern)
GL.glColorMask(ColorMask[0], ColorMask[1], ColorMask[2], ColorMask[3]);
}
if(modern && HasExt[EXT_depth_bounds_test])
{
GL.glDepthBoundsEXT(bounds[0], bounds[1]);
}
if(!IsGLES)
GL.glPolygonMode(eGL_FRONT_AND_BACK, PolygonMode);
+2 -1
View File
@@ -501,12 +501,13 @@ struct GLMarkerRegion
// - i.e. change state through here, and track dirty bits.
struct GLPushPopState
{
bool enableBits[8];
bool enableBits[9];
GLenum ClipOrigin, ClipDepth;
GLenum EquationRGB, EquationAlpha;
GLenum SourceRGB, SourceAlpha;
GLenum DestinationRGB, DestinationAlpha;
GLenum PolygonMode;
GLdouble bounds[2];
GLfloat Viewportf[4];
GLint Viewport[4];
GLenum ActiveTexture;
+2
View File
@@ -409,6 +409,8 @@ void WrappedOpenGL::RenderTextInternal(float x, float y, const rdcstr &text)
GL.glDisable(eGL_STENCIL_TEST);
GL.glDisable(eGL_CULL_FACE);
GL.glDisable(eGL_RASTERIZER_DISCARD);
if(HasExt[EXT_depth_bounds_test])
GL.glDisable(eGL_DEPTH_BOUNDS_TEST_EXT);
GL.glBindFramebuffer(eGL_DRAW_FRAMEBUFFER, 0);