Fix for my last commit, this must fix the problem in the algorithm pointed by neobrain. thanks
This commit is contained in:
parent
bdf54edc87
commit
48d8d71391
|
@ -154,6 +154,9 @@ void VertexManager::vFlush()
|
||||||
VertexShaderManager::SetConstants();
|
VertexShaderManager::SetConstants();
|
||||||
PixelShaderManager::SetConstants();
|
PixelShaderManager::SetConstants();
|
||||||
|
|
||||||
|
int stride = g_nativeVertexFmt->GetVertexStride();
|
||||||
|
g_nativeVertexFmt->SetupVertexPointers();
|
||||||
|
|
||||||
if (!VertexShaderCache::SetShader(g_nativeVertexFmt->m_components))
|
if (!VertexShaderCache::SetShader(g_nativeVertexFmt->m_components))
|
||||||
{
|
{
|
||||||
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set vertex shader\n");});
|
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set vertex shader\n");});
|
||||||
|
@ -161,22 +164,6 @@ void VertexManager::vFlush()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int stride = g_nativeVertexFmt->GetVertexStride();
|
|
||||||
g_nativeVertexFmt->SetupVertexPointers();
|
|
||||||
bool UseZcomploc = bpmem.zcontrol.zcomploc && bpmem.zmode.updateenable && g_ActiveConfig.bAcurateZcomploc;
|
|
||||||
if (UseZcomploc)
|
|
||||||
{
|
|
||||||
if (!PixelShaderCache::SetShader(DSTALPHA_ZCOMPLOC,g_nativeVertexFmt->m_components))
|
|
||||||
{
|
|
||||||
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
|
|
||||||
goto shader_fail;
|
|
||||||
}
|
|
||||||
g_renderer->ApplyState(RSM_Zcomploc);
|
|
||||||
Draw(stride);
|
|
||||||
g_renderer->RestoreState(RSM_Zcomploc);
|
|
||||||
g_renderer->ApplyState(RSM_Multipass);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!PixelShaderCache::SetShader(DSTALPHA_NONE,g_nativeVertexFmt->m_components))
|
if (!PixelShaderCache::SetShader(DSTALPHA_NONE,g_nativeVertexFmt->m_components))
|
||||||
{
|
{
|
||||||
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
|
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
|
||||||
|
@ -196,16 +183,28 @@ void VertexManager::vFlush()
|
||||||
}
|
}
|
||||||
// update alpha only
|
// update alpha only
|
||||||
g_renderer->ApplyState(RSM_UseDstAlpha);
|
g_renderer->ApplyState(RSM_UseDstAlpha);
|
||||||
if(!UseZcomploc && bpmem.zmode.updateenable)
|
if (bpmem.zmode.updateenable)
|
||||||
g_renderer->ApplyState(RSM_Multipass);
|
g_renderer->ApplyState(RSM_Multipass);
|
||||||
Draw(stride);
|
Draw(stride);
|
||||||
g_renderer->RestoreState(RSM_UseDstAlpha);
|
g_renderer->RestoreState(RSM_UseDstAlpha);
|
||||||
}
|
if (bpmem.zmode.updateenable)
|
||||||
|
|
||||||
if (UseZcomploc || (useDstAlpha && bpmem.zmode.updateenable))
|
|
||||||
{
|
|
||||||
g_renderer->RestoreState(RSM_Multipass);
|
g_renderer->RestoreState(RSM_Multipass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UseZcomploc = bpmem.zcontrol.zcomploc && bpmem.zmode.updateenable && g_ActiveConfig.bAcurateZcomploc;
|
||||||
|
|
||||||
|
if (UseZcomploc)
|
||||||
|
{
|
||||||
|
if (!PixelShaderCache::SetShader(DSTALPHA_ZCOMPLOC,g_nativeVertexFmt->m_components))
|
||||||
|
{
|
||||||
|
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
|
||||||
|
goto shader_fail;
|
||||||
|
}
|
||||||
|
g_renderer->ApplyState(RSM_Zcomploc);
|
||||||
|
Draw(stride);
|
||||||
|
g_renderer->RestoreState(RSM_Zcomploc);
|
||||||
|
}
|
||||||
|
|
||||||
GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true);
|
GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true);
|
||||||
|
|
||||||
shader_fail:
|
shader_fail:
|
||||||
|
|
Loading…
Reference in New Issue