Second Stage: re implement zcomplock and correct all the logic error in PixelShaderGen.cpp. i disable fastzcomlock for the moment to avoid confusions.

please test for regressions
This commit is contained in:
rodolfoosvaldobogado
2012-04-03 00:08:36 -03:00
parent a0d60210fd
commit 6a446efd5f
13 changed files with 201 additions and 140 deletions

View File

@ -154,7 +154,7 @@ void VertexManager::vFlush()
VertexShaderManager::SetConstants();
PixelShaderManager::SetConstants();
if (!PixelShaderCache::SetShader(DSTALPHA_NONE,g_nativeVertexFmt->m_components))
if (!PixelShaderCache::SetShader(PSGRENDER_NORMAL,g_nativeVertexFmt->m_components))
{
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
goto shader_fail;
@ -175,8 +175,7 @@ void VertexManager::vFlush()
bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
if (useDstAlpha)
{
DWORD write = 0;
if (!PixelShaderCache::SetShader(DSTALPHA_ALPHA_PASS, g_nativeVertexFmt->m_components))
if (!PixelShaderCache::SetShader(PSGRENDER_DSTALPHA_ALPHA_PASS, g_nativeVertexFmt->m_components))
{
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
goto shader_fail;
@ -186,6 +185,20 @@ void VertexManager::vFlush()
Draw(stride);
g_renderer->RestoreState();
}
bool useZcomploc = bpmem.zcontrol.zcomploc && bpmem.zmode.updateenable;
if(useZcomploc)
{
if (!PixelShaderCache::SetShader(PSGRENDER_ZCOMPLOCK, g_nativeVertexFmt->m_components))
{
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
goto shader_fail;
}
// update Depth only
g_renderer->ApplyState(RSM_Zcomploc);
Draw(stride);
g_renderer->RestoreState();
}
GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true);
shader_fail: