dx11,gl: fix clear framebuffer and scissor regressions

dx11: don't use scissor rect for final A-buffer render
gl4: clear geom_fbo[1] (color pass) not geom_fbo[0] (depth pass) when
needed
Issue #1197
This commit is contained in:
Flyinghead committed 2026-10-13 11:14:45 +02:00
1 parent f03faffd2f
commit 804edb00d7
2 files changed
+12 -3

No files matched your search

+10 -1
View File
@@ -455,7 +455,16 @@ struct DX11OITRenderer : public DX11Renderer
deviceContext->PSSetShaderResources(0, 1, &opaqueTextureView.get());
auto sampler = samplers->getSampler(false);
deviceContext->PSSetSamplers(0, 1, &sampler.get());
deviceContext->RSSetScissorRects(1, &scissorRect);
D3D11_RECT rect {};
if (rendContext->isRTT) {
rect.right = rendContext->framebufferWidth;
rect.bottom = rendContext->framebufferHeight;
}
else {
rect.right = width;
rect.bottom = height;
}
deviceContext->RSSetScissorRects(1, &rect);
deviceContext->OMSetDepthStencilState(depthStencilStates.getState(false, false, 0, false), 0);
setCullMode(0);
+2 -2
View File
@@ -486,7 +486,6 @@ void gl4CreateTextures(int width, int height)
void gl4DrawStrips(GLuint output_fbo, int width, int height)
{
checkOverflowAndReset();
glBindFramebuffer(GL_FRAMEBUFFER, geom_fbo[0]);
if (!gl.rendContext->isRTT)
{
glcache.Disable(GL_SCISSOR_TEST);
@@ -494,6 +493,7 @@ void gl4DrawStrips(GLuint output_fbo, int width, int height)
if (gl.rendContext->clearFramebuffer)
{
// Clear framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, geom_fbo[1]);
glcache.ClearColor(VO_BORDER_COL.red(), VO_BORDER_COL.green(), VO_BORDER_COL.blue(), 1.f);
glClear(GL_COLOR_BUFFER_BIT);
}
@@ -504,7 +504,6 @@ void gl4DrawStrips(GLuint output_fbo, int width, int height)
glBindFramebuffer(GL_READ_FRAMEBUFFER, output_fbo);
glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
glCheck();
glBindFramebuffer(GL_FRAMEBUFFER, geom_fbo[0]);
}
if (gl4ShaderUniforms.base_clipping.enabled)
glcache.Enable(GL_SCISSOR_TEST);
@@ -512,6 +511,7 @@ void gl4DrawStrips(GLuint output_fbo, int width, int height)
if (texSamplers[0] == 0)
glGenSamplers(2, texSamplers);
glBindFramebuffer(GL_FRAMEBUFFER, geom_fbo[0]);
glcache.DepthMask(GL_TRUE);
glClearDepthf(0.f);
glcache.StencilMask(0xFF);