summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorrodolfoosvaldobogado <rodolfoosvaldobogado@gmail.com>2012-03-27 23:14:59 -0300
committerrodolfoosvaldobogado <rodolfoosvaldobogado@gmail.com>2012-03-27 23:14:59 -0300
commit48d8d71391fc2cc40d85732680eb6421164bf87c (patch)
treed1ffda3f3c9ea06b3f791c057dbaf6d3c0e924bb /Source
parentbdf54edc8762fc6cdbfcdf0c641300c41a72803b (diff)
Fix for my last commit, this must fix the problem in the algorithm pointed by neobrain. thanks
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
index 82ee8d1623..8dd13f3e3b 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexManager.cpp
@@ -154,6 +154,9 @@ void VertexManager::vFlush()
VertexShaderManager::SetConstants();
PixelShaderManager::SetConstants();
+ int stride = g_nativeVertexFmt->GetVertexStride();
+ g_nativeVertexFmt->SetupVertexPointers();
+
if (!VertexShaderCache::SetShader(g_nativeVertexFmt->m_components))
{
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))
{
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
g_renderer->ApplyState(RSM_UseDstAlpha);
- if(!UseZcomploc && bpmem.zmode.updateenable)
+ if (bpmem.zmode.updateenable)
g_renderer->ApplyState(RSM_Multipass);
Draw(stride);
g_renderer->RestoreState(RSM_UseDstAlpha);
+ if (bpmem.zmode.updateenable)
+ g_renderer->RestoreState(RSM_Multipass);
}
-
- if (UseZcomploc || (useDstAlpha && bpmem.zmode.updateenable))
+
+ bool UseZcomploc = bpmem.zcontrol.zcomploc && bpmem.zmode.updateenable && g_ActiveConfig.bAcurateZcomploc;
+
+ if (UseZcomploc)
{
- g_renderer->RestoreState(RSM_Multipass);
+ 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);
shader_fail: