Skip to content

Commit

Permalink
gl oit: fix several issues
Browse files Browse the repository at this point in the history
Disable blending when rendering a-buffers. Fixes ECW Anarchy Rulz black
title screen and Demolition Racer glitchy end of race screen.

Use palette in the depth pass for punch-through polygons using palette
texture. Fixes shadow issue in Alone in the Dark.

Copy ouput fbo to geom_fbo before drawing. Fixes missing transparent
polygons in subsequent partial renders. Fixes Test Drive Le Mans missing
labels in loading screen.

Issue #1262
  • Loading branch information
flyinghead committed Oct 25, 2023
1 parent 98a0f2b commit 8fb3def
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions core/rend/gl4/abuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ void renderABuffer(bool lastPass)
glcache.Disable(GL_CULL_FACE);
glcache.Disable(GL_SCISSOR_TEST);
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT | GL_BUFFER_UPDATE_BARRIER_BIT);
glcache.Disable(GL_BLEND);

abufferDrawQuad();

Expand Down
24 changes: 19 additions & 5 deletions core/rend/gl4/gldraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ static void SetGPState(const PolyParam* gp)

int clip_rect[4] = {};
TileClipping clipmode = GetTileClip(gp->tileclip, ViewportMatrix, clip_rect);
bool gpuPalette = false;
bool gpuPalette;

if (pass == Pass::Depth)
{
gpuPalette = gp->texture != nullptr && Type == ListType_Punch_Through ? gp->texture->gpuPalette : false;
CurrentShader = gl4GetProgram(Type == ListType_Punch_Through ? true : false,
clipmode == TileClipping::Inside,
Type == ListType_Punch_Through ? gp->pcw.Texture : false,
Expand All @@ -133,7 +134,7 @@ static void SetGPState(const PolyParam* gp)
false,
false,
false,
false,
gpuPalette,
gp->isNaomi2(),
pass);
}
Expand Down Expand Up @@ -481,12 +482,25 @@ void gl4DrawStrips(GLuint output_fbo, int width, int height)
{
checkOverflowAndReset();
glBindFramebuffer(GL_FRAMEBUFFER, geom_fbo);
if (!pvrrc.isRTT && pvrrc.clearFramebuffer)
if (!pvrrc.isRTT)
{
glcache.Disable(GL_SCISSOR_TEST);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glcache.ClearColor(VO_BORDER_COL.red(), VO_BORDER_COL.green(), VO_BORDER_COL.blue(), 1.f);
glClear(GL_COLOR_BUFFER_BIT);
if (pvrrc.clearFramebuffer)
{
// Clear framebuffer
glcache.ClearColor(VO_BORDER_COL.red(), VO_BORDER_COL.green(), VO_BORDER_COL.blue(), 1.f);
glClear(GL_COLOR_BUFFER_BIT);
}
else
{
// Copy previous framebuffer content (in case of partial render)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, geom_fbo);
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);
}
if (gl4ShaderUniforms.base_clipping.enabled)
glcache.Enable(GL_SCISSOR_TEST);
}
Expand Down

0 comments on commit 8fb3def

Please sign in to comment.