mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 23:58:59 +00:00
Optimized vertex and pixel shader generation. Medium FPS boost.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@500 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
3cc7e501af
commit
ba4143e82b
3 changed files with 69 additions and 25 deletions
|
@ -152,9 +152,15 @@ void VShaderCache::Shutdown()
|
|||
|
||||
void VShaderCache::SetShader()
|
||||
{
|
||||
static LPDIRECT3DVERTEXSHADER9 shader = NULL;
|
||||
if (D3D::GetShaderVersion() < 2)
|
||||
return; // we are screwed
|
||||
|
||||
if(shader) {
|
||||
//D3D::dev->SetVertexShader(shader);
|
||||
return;
|
||||
}
|
||||
|
||||
static LPDIRECT3DVERTEXSHADER9 lastShader = 0;
|
||||
DVSTARTPROFILE();
|
||||
|
||||
|
@ -176,7 +182,7 @@ void VShaderCache::SetShader()
|
|||
}
|
||||
|
||||
const char *code = GenerateVertexShader();
|
||||
LPDIRECT3DVERTEXSHADER9 shader = D3D::CompileVShader(code, int(strlen(code)));
|
||||
shader = D3D::CompileVShader(code, int(strlen(code)));
|
||||
if (shader)
|
||||
{
|
||||
//Make an entry in the table
|
||||
|
@ -185,6 +191,7 @@ void VShaderCache::SetShader()
|
|||
entry.frameCount=frameCount;
|
||||
vshaders[currentHash] = entry;
|
||||
}
|
||||
|
||||
D3D::dev->SetVertexShader(shader);
|
||||
|
||||
INCSTAT(stats.numVertexShadersCreated);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue