gsdx-ogl: improve debug of stencil

Note: ENABLE_OGL_STENCIL_DEBUG could be dropped now that I can read the stencil properly
This commit is contained in:
Gregory Hainaut 2015-04-30 19:37:03 +02:00
parent 7887d7b5a5
commit 2bd9043657
3 changed files with 6 additions and 1 deletions

View File

@ -962,6 +962,7 @@ void GSDeviceOGL::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* ver
#ifdef ENABLE_OGL_STENCIL_DEBUG
const GSVector2i& size = rt->GetSize();
GSTexture* t = CreateRenderTarget(size.x, size.y, false);
ClearRenderTarget(t, 0);
#else
GSTexture* t = NULL;
#endif

View File

@ -180,7 +180,7 @@ public:
{
// Only needed once since m_stencil_mask is constant
// Control which stencil bitplane are written
glStencilMask(1);
glStencilMask(0xFF);
}
void EnableDepth() { m_depth_enable = true; }

View File

@ -51,6 +51,10 @@ void GSDeviceOGL::CreateTextureFX()
m_vs[key] = CompileVS(sel, logz);
}
// Enable all bits for stencil operations. Technically 1 bit is
// enough but buffer is polluted with noise. Clear will be limited
// to the mask.
glStencilMask(0xFF);
for (uint32 key = 0; key < OMDepthStencilSelector::size(); key++)
m_om_dss[key] = CreateDepthStencil(OMDepthStencilSelector(key));