mirror of
https://github.com/blawar/GLideN64.git
synced 2024-06-25 22:09:35 +00:00
Fix depth buffer clear when otherMode.depthCompare enabled.
Fixed 1080 Snowboarding (JU) FB off breaks games ( regression) #1976
This commit is contained in:
parent
f79f8d406a
commit
2b7f78c9f8
|
@ -670,7 +670,7 @@ public:
|
|||
{
|
||||
int renderTarget = 0;
|
||||
if (isCurrentColorImageDepthImage()) {
|
||||
renderTarget = gDP.otherMode.depthCompare + 1;
|
||||
renderTarget = isDepthCompareEnabled() ? 2 : 1;
|
||||
}
|
||||
uRenderTarget.set(renderTarget, _force);
|
||||
}
|
||||
|
|
|
@ -679,7 +679,7 @@ void GraphicsDrawer::_updateStates(DrawingState _drawingState) const
|
|||
// Current render target is depth buffer.
|
||||
// Shader will set gl_FragDepth to shader color, see ShaderCombiner ctor
|
||||
// Here we enable depth buffer write.
|
||||
if (gDP.otherMode.depthCompare != 0) {
|
||||
if (gDP.otherMode.cycleType <= G_CYC_2CYCLE && gDP.otherMode.depthCompare != 0) {
|
||||
// Render to depth buffer with depth compare. Need to get copy of current depth buffer.
|
||||
FrameBuffer * pCurBuf = frameBufferList().getCurrent();
|
||||
if (pCurBuf != nullptr && pCurBuf->m_pDepthBuffer != nullptr) {
|
||||
|
@ -695,8 +695,7 @@ void GraphicsDrawer::_updateStates(DrawingState _drawingState) const
|
|||
params.magFilter = textureParameters::FILTER_NEAREST;
|
||||
gfxContext.setTextureParameters(params);
|
||||
}
|
||||
}
|
||||
else if (frameBufferList().getCurrent() == nullptr) {
|
||||
} else if (frameBufferList().getCurrent() == nullptr) {
|
||||
gfxContext.enable(enable::BLEND, true);
|
||||
gfxContext.setBlending(blend::ZERO, blend::ONE);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,13 @@ bool isCurrentColorImageDepthImage()
|
|||
(gDP.fillColor.color == DepthClearColor && gDP.otherMode.cycleType == G_CYC_FILL);
|
||||
}
|
||||
|
||||
bool isDepthCompareEnabled()
|
||||
{
|
||||
return gDP.otherMode.cycleType <= G_CYC_2CYCLE &&
|
||||
gDP.otherMode.depthCompare != 0 &&
|
||||
((gSP.geometryMode & G_ZBUFFER) || gDP.otherMode.depthSource == G_ZS_PRIM);
|
||||
}
|
||||
|
||||
void gDPSetOtherMode( u32 mode0, u32 mode1 )
|
||||
{
|
||||
gDP.otherMode.h = mode0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user