Moved some of the new shader uid stuff to a common header file.

This commit is contained in:
NeoBrainX
2012-08-06 23:09:43 +02:00
parent ca0e292dd4
commit 3c8df842bb
9 changed files with 1196 additions and 80 deletions

View File

@ -42,7 +42,7 @@ GLuint VertexShaderCache::CurrentShader;
bool VertexShaderCache::ShaderEnabled;
VertexShaderCache::VSCacheEntry* VertexShaderCache::last_entry = NULL;
ShaderUid VertexShaderCache::last_uid;
VertexShaderUid VertexShaderCache::last_uid;
static int s_nMaxVertexInstructions;
@ -75,8 +75,8 @@ void VertexShaderCache::Shutdown()
VERTEXSHADER* VertexShaderCache::SetShader(u32 components)
{
// Possible optimization: Don't always generate the shader uid, but keep track of changes in BPStructs instead
ShaderUid uid;
GenerateShaderUid(uid, components, API_OPENGL);
VertexShaderUid uid;
GetVertexShaderUid(uid, components, API_OPENGL);
if (last_entry)
{
if (uid == last_uid)
@ -101,8 +101,8 @@ VERTEXSHADER* VertexShaderCache::SetShader(u32 components)
// Make an entry in the table
VSCacheEntry& entry = vshaders[uid];
last_entry = &entry;
ShaderCode code;
GenerateShaderCode(code, components, API_OPENGL);
VertexShaderCode code;
GenerateVertexShaderCode(code, components, API_OPENGL);
#if defined(_DEBUG) || defined(DEBUGFAST)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && code) {