ShaderGen: Only specify storage qualifier in interface block when needed

Drivers that don't support GL_ARB_shading_language_420pack require that
the storage qualifier be specified even when inside an interface block.

AMD's driver throws a compile error when "centroid in/out" is used within
an interface block.

Our previous behavior was to include the storage qualifier regardless, but
this wasn't working on AMD, therefore we should check for the presence of
the extension and include based on this, instead.
This commit is contained in:
Stenzek
2016-03-29 13:35:16 +10:00
parent 6d42054274
commit e6b2212ec0
4 changed files with 33 additions and 27 deletions

View File

@ -90,16 +90,15 @@ static T GenerateGeometryShader(u32 primitive_type, API_TYPE ApiType)
if (g_ActiveConfig.backend_info.bSupportsGSInstancing)
out.Write("#define InstanceID gl_InvocationID\n");
out.Write("// The interface block qualifier is duplicated to its member due to Apple OS X bug 24983074\n");
out.Write("in VertexData {\n");
GenerateVSOutputMembers<T>(out, ApiType, "in", GetInterpolationQualifier());
GenerateVSOutputMembers<T>(out, ApiType, GetInterpolationQualifier(true, true));
out.Write("} vs[%d];\n", vertex_in);
out.Write("out VertexData {\n");
GenerateVSOutputMembers<T>(out, ApiType, "out", GetInterpolationQualifier());
GenerateVSOutputMembers<T>(out, ApiType, GetInterpolationQualifier(true, false));
if (g_ActiveConfig.iStereoMode > 0)
out.Write("\tflat out int layer;\n");
out.Write("\tflat int layer;\n");
out.Write("} ps;\n");