ProgramShaderCache: Always generate a geometry shader UID, even if stereoscopy is disabled.

This commit is contained in:
Jules Blok 2014-10-30 14:24:23 +01:00
parent 6cacfad010
commit f370cb386c
2 changed files with 3 additions and 4 deletions

View File

@ -220,7 +220,7 @@ SHADER* ProgramShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components
filename = StringFromFormat("%sps_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), counter++); filename = StringFromFormat("%sps_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), counter++);
SaveData(filename, pcode.GetBuffer()); SaveData(filename, pcode.GetBuffer());
if (g_ActiveConfig.bStereo) if (gcode.GetBuffer() != nullptr)
{ {
filename = StringFromFormat("%sgs_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), counter++); filename = StringFromFormat("%sgs_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), counter++);
SaveData(filename, gcode.GetBuffer()); SaveData(filename, gcode.GetBuffer());
@ -387,8 +387,7 @@ void ProgramShaderCache::GetShaderId(SHADERUID* uid, DSTALPHA_MODE dstAlphaMode,
{ {
GetPixelShaderUid(uid->puid, dstAlphaMode, API_OPENGL, components); GetPixelShaderUid(uid->puid, dstAlphaMode, API_OPENGL, components);
GetVertexShaderUid(uid->vuid, components, API_OPENGL); GetVertexShaderUid(uid->vuid, components, API_OPENGL);
if (g_ActiveConfig.bStereo) GetGeometryShaderUid(uid->guid, components, API_OPENGL);
GetGeometryShaderUid(uid->guid, components, API_OPENGL);
if (g_ActiveConfig.bEnableShaderDebugging) if (g_ActiveConfig.bEnableShaderDebugging)
{ {

View File

@ -41,10 +41,10 @@ static inline void GenerateGeometryShader(T& out, u32 components, API_TYPE ApiTy
out.Write("//Geometry Shader for 3D stereoscopy\n"); out.Write("//Geometry Shader for 3D stereoscopy\n");
uid_data->stereo = g_ActiveConfig.bStereo;
if (ApiType == API_OPENGL) if (ApiType == API_OPENGL)
{ {
// Insert layout parameters // Insert layout parameters
uid_data->stereo = g_ActiveConfig.bStereo;
if (g_ActiveConfig.backend_info.bSupportsGSInstancing) if (g_ActiveConfig.backend_info.bSupportsGSInstancing)
out.Write("layout(triangles, invocations = %d) in;\n", g_ActiveConfig.bStereo ? 2 : 1); out.Write("layout(triangles, invocations = %d) in;\n", g_ActiveConfig.bStereo ? 2 : 1);
else else