GeometryShaderGen: Pass the primitive type and always run the generator regardless of stereoscopy.

This commit is contained in:
Jules Blok 2014-12-14 19:41:16 +01:00
parent b406e4e1f2
commit aa4242fd9c
8 changed files with 28 additions and 32 deletions

View file

@ -171,10 +171,10 @@ GLuint ProgramShaderCache::GetCurrentProgram()
return CurrentProgram;
}
SHADER* ProgramShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components)
SHADER* ProgramShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components, u32 primitive_type)
{
SHADERUID uid;
GetShaderId(&uid, dstAlphaMode, components);
GetShaderId(&uid, dstAlphaMode, components, primitive_type);
// Check if the shader is already set
if (last_entry)
@ -211,8 +211,7 @@ SHADER* ProgramShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components
ShaderCode gcode;
GenerateVertexShaderCode(vcode, components, API_OPENGL);
GeneratePixelShaderCode(pcode, dstAlphaMode, API_OPENGL, components);
if (g_ActiveConfig.iStereoMode > 0)
GenerateGeometryShaderCode(gcode, components, API_OPENGL);
GenerateGeometryShaderCode(gcode, primitive_type, API_OPENGL);
if (g_ActiveConfig.bEnableShaderDebugging)
{
@ -395,7 +394,7 @@ GLuint ProgramShaderCache::CompileSingleShader(GLuint type, const char* code)
return result;
}
void ProgramShaderCache::GetShaderId(SHADERUID* uid, DSTALPHA_MODE dstAlphaMode, u32 components)
void ProgramShaderCache::GetShaderId(SHADERUID* uid, DSTALPHA_MODE dstAlphaMode, u32 components, u32 primitive_type)
{
GetPixelShaderUid(uid->puid, dstAlphaMode, API_OPENGL, components);
GetVertexShaderUid(uid->vuid, components, API_OPENGL);
@ -412,7 +411,7 @@ void ProgramShaderCache::GetShaderId(SHADERUID* uid, DSTALPHA_MODE dstAlphaMode,
vertex_uid_checker.AddToIndexAndCheck(vcode, uid->vuid, "Vertex", "v");
ShaderCode gcode;
GenerateGeometryShaderCode(gcode, components, API_OPENGL);
GenerateGeometryShaderCode(gcode, primitive_type, API_OPENGL);
geometry_uid_checker.AddToIndexAndCheck(gcode, uid->guid, "Geometry", "g");
}
}