mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
D3D: Minor bug fix and some code cleanup for DirectX API call reduction.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4244 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -32,7 +32,6 @@
|
||||
|
||||
VertexShaderCache::VSCache VertexShaderCache::vshaders;
|
||||
const VertexShaderCache::VSCacheEntry *VertexShaderCache::last_entry;
|
||||
VERTEXSHADERUID VertexShaderCache::last_entry_uid;
|
||||
|
||||
static float lastVSconstants[C_FOGPARAMS+8][4];
|
||||
|
||||
@ -69,10 +68,11 @@ void SetVSConstant4fv(int const_number, const float *f)
|
||||
|
||||
void VertexShaderCache::Init()
|
||||
{
|
||||
for( int i=0; i<C_FOGPARAMS+8*4; i++)
|
||||
lastVSconstants[i/4][i%4]=-1;
|
||||
|
||||
memset(last_entry_uid.values,0xFF,sizeof(last_entry_uid.values));
|
||||
//memset(lastVSconstants,0xFF,(C_FOGPARAMS+8)*4*sizeof(float)); // why does this not work
|
||||
//memset(lastVSconstants,0xFF,sizeof(lastVSconstants));
|
||||
for( int i=0;i<(C_FOGPARAMS+8)*4;i++)
|
||||
lastVSconstants[i/4][i%4] = -100000000.0f;
|
||||
memset(&last_vertex_shader_uid,0xFF,sizeof(last_vertex_shader_uid));
|
||||
}
|
||||
|
||||
void VertexShaderCache::Shutdown()
|
||||
@ -89,14 +89,14 @@ bool VertexShaderCache::SetShader(u32 components)
|
||||
|
||||
VERTEXSHADERUID uid;
|
||||
GetVertexShaderId(uid, components);
|
||||
if (uid == last_entry_uid)
|
||||
if (uid == last_vertex_shader_uid)
|
||||
{
|
||||
if (vshaders[uid].shader)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
memcpy(&last_entry_uid, &uid, sizeof(VERTEXSHADERUID));
|
||||
memcpy(&last_vertex_shader_uid, &uid, sizeof(VERTEXSHADERUID));
|
||||
|
||||
VSCache::iterator iter;
|
||||
iter = vshaders.find(uid);
|
||||
|
Reference in New Issue
Block a user