Revert the recent zcomploc changes including the Graphic_Fixes merge.

Reason:
- It's wrong, zcomploc can't be emulated perfectly in HW backends without severely impacting performance.
- It provides virtually no advantages over the previous hack while introducing lots of code.
- There is a better alternative: If people insist on having some sort of valid zcomploc emulation, I suggest rendering each primitive separately while using a _clean_ dual-pass approach to emulate zcomploc.

This reverts commit 0efd4e5c29.
This reverts commit b4ec836aca.
This reverts commit bb4c9e2205.
This reverts commit 146b02615c.
This commit is contained in:
NeoBrainX
2012-08-10 18:57:37 +02:00
parent 6e02ad55bc
commit 08a9c66037
22 changed files with 211 additions and 358 deletions

View File

@ -187,21 +187,21 @@ void VertexManager::vFlush()
// If host supports GL_ARB_blend_func_extended, we can do dst alpha in
// the same pass as regular rendering.
g_renderer->SetBlendMode(true);
ps = PixelShaderCache::SetShader(PSGRENDER_DSTALPHA_DUAL_SOURCE_BLEND, g_nativeVertexFmt->m_components);
ps = PixelShaderCache::SetShader(DSTALPHA_DUAL_SOURCE_BLEND, g_nativeVertexFmt->m_components);
}
else
{
g_renderer->SetBlendMode(true);
ps = PixelShaderCache::SetShader(PSGRENDER_NORMAL,g_nativeVertexFmt->m_components);
ps = PixelShaderCache::SetShader(DSTALPHA_NONE,g_nativeVertexFmt->m_components);
}
}
else
{
ps = PixelShaderCache::SetShader(PSGRENDER_NORMAL,g_nativeVertexFmt->m_components);
ps = PixelShaderCache::SetShader(DSTALPHA_NONE,g_nativeVertexFmt->m_components);
}
#else
bool dualSourcePossible = false;
FRAGMENTSHADER* ps = PixelShaderCache::SetShader(PSGRENDER_NORMAL,g_nativeVertexFmt->m_components);
FRAGMENTSHADER* ps = PixelShaderCache::SetShader(DSTALPHA_NONE,g_nativeVertexFmt->m_components);
#endif
VERTEXSHADER* vs = VertexShaderCache::SetShader(g_nativeVertexFmt->m_components);
if (ps) PixelShaderCache::SetCurrentShader(ps->glprogid); // Lego Star Wars crashes here.
@ -212,22 +212,20 @@ void VertexManager::vFlush()
// run through vertex groups again to set alpha
if (useDstAlpha && !dualSourcePossible)
{
ps = PixelShaderCache::SetShader(PSGRENDER_DSTALPHA_ALPHA_PASS,g_nativeVertexFmt->m_components);
ps = PixelShaderCache::SetShader(DSTALPHA_ALPHA_PASS,g_nativeVertexFmt->m_components);
if (ps) PixelShaderCache::SetCurrentShader(ps->glprogid);
g_renderer->ApplyState(RSM_UseDstAlpha | (bpmem.zmode.updateenable ? RSM_Multipass : RSM_None));
Draw();
g_renderer->RestoreState();
}
bool useZcomploc = bpmem.zcontrol.zcomploc && bpmem.zmode.updateenable;
if (useZcomploc && PixelShaderManager::AlphaPreTest() == ALPHAPT_UNDEFINED)
{
ps = PixelShaderCache::SetShader(PSGRENDER_ZCOMPLOC,g_nativeVertexFmt->m_components);
if (ps) PixelShaderCache::SetCurrentShader(ps->glprogid);
// only update alpha
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
g_renderer->ApplyState(RSM_Zcomploc);
Draw();
g_renderer->RestoreState();
glDisable(GL_BLEND);
Draw();
// restore color mask
g_renderer->SetColorMask();
if (bpmem.blendmode.blendenable || bpmem.blendmode.subtract)
glEnable(GL_BLEND);
}
GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true);