mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 14:15:42 +00:00
Add ultra dirty specific hack to work around mesa following GL spec
* The GL spec is absolutely and maliciously unhinged and the queried stencil value will be clamped to 0 if no stencil texture is currently bound. This of course will break in so many different places that will never get fixed, but this minimal change at least allows autotests to run on mesa.
This commit is contained in:
@@ -2162,6 +2162,18 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug
|
||||
eGL_CLAMP_TO_EDGE);
|
||||
|
||||
drv.glFramebufferTextureLayer(eGL_FRAMEBUFFER, dsAttach, overridedepth, 0, 0);
|
||||
|
||||
// this is a MEGA hack for mesa's behaviour - which is spec compliant. The problem is that
|
||||
// the spec is absolutely stupid. When we called CopyTex2DMSToArray() above the
|
||||
// framebuffer might have been incomplete since we hadn't bound this overridedepth here
|
||||
// that we are setting up. This means that the effective stencil bits available in the FBO
|
||||
// is 0, and mesa then clamps the query of the current stencil reference to 0. The render
|
||||
// state push + pop inside CopyTex2DMSToArray then doesn't function correctly as it leaves
|
||||
// the reference at 0 instead of whatever it should be - so we reset it here
|
||||
GL.glStencilFuncSeparate(eGL_FRONT, rs.StencilFront.func, rs.StencilFront.ref,
|
||||
rs.StencilFront.valuemask);
|
||||
GL.glStencilFuncSeparate(eGL_BACK, rs.StencilBack.func, rs.StencilBack.ref,
|
||||
rs.StencilBack.valuemask);
|
||||
}
|
||||
|
||||
drv.glBindFramebuffer(eGL_DRAW_FRAMEBUFFER, curdrawfbo);
|
||||
|
||||
Reference in New Issue
Block a user