D3D: get rid of flickering in various games by changing way and time to flip backbuffer to frontbuffer. Also added some debugging messages. ZTP intro seems to be additionally 10%+ faster now, maybe only for me in windows mode.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4303 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
rice1964
2009-09-20 03:29:43 +00:00
parent 7a8f6bdd6d
commit 81e7ce9ad2
8 changed files with 139 additions and 65 deletions

View File

@ -273,7 +273,10 @@ void Flush()
PixelShaderManager::SetTexDims(i, tentry->w, tentry->h, 0, 0);
}
else
{
DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to load texture\n");});
ERROR_LOG(VIDEO, "error loading texture");
}
}
}
PixelShaderManager::SetTexturesUsed(0);
@ -285,10 +288,17 @@ void Flush()
VertexShaderManager::SetConstants();
PixelShaderManager::SetConstants();
if (!VertexShaderCache::SetShader(g_nativeVertexFmt->m_components))
goto shader_fail;
if (!PixelShaderCache::SetShader(false))
{
DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
goto shader_fail;
}
if (!VertexShaderCache::SetShader(g_nativeVertexFmt->m_components))
{
DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set vertex shader\n");});
goto shader_fail;
}
int stride = g_nativeVertexFmt->GetVertexStride();
g_nativeVertexFmt->SetupVertexPointers();
@ -299,7 +309,11 @@ void Flush()
{
DWORD write = 0;
if (!PixelShaderCache::SetShader(true))
{
DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
goto shader_fail;
}
// update alpha only
D3D::SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA);
D3D::SetRenderState(D3DRS_ALPHABLENDENABLE, false);
@ -315,13 +329,12 @@ void Flush()
D3D::SetRenderState(D3DRS_COLORWRITEENABLE, write);
}
DEBUGGER_PAUSE_AT(NEXT_FLUSH,true);
}
shader_fail:
collection = C_NOTHING;
VertexManager::s_pCurBufferPointer = fakeVBuffer;
DEBUGGER_PAUSE_AT(NEXT_FLUSH,true);
}
//DX9DEBUGGER_PAUSE_IF(NEXT_FLUSH);
}
} // namespace