mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 14:15:42 +00:00
Disable depth bounds test when rendering GL overlay
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user