mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00:00
Workaround OS X video driver bug #24983074
OS X's shader compiler has a bug with interface blocks where interface block members don't properly inherit the layout qualifier from the interface block. Work around this limitation by explicitly stating the layout qualifier on both the interface block and every single member inside of that block.
This commit is contained in:
parent
370e91d4c0
commit
3ab7806e24
4 changed files with 42 additions and 43 deletions
|
@ -82,7 +82,7 @@ static T GenerateGeometryShader(u32 primitive_type, API_TYPE ApiType)
|
|||
uid_data->pixel_lighting = g_ActiveConfig.bEnablePixelLighting;
|
||||
|
||||
out.Write("struct VS_OUTPUT {\n");
|
||||
GenerateVSOutputMembers<T>(out, ApiType);
|
||||
GenerateVSOutputMembers<T>(out, ApiType, "");
|
||||
out.Write("};\n");
|
||||
|
||||
if (ApiType == API_OPENGL)
|
||||
|
@ -90,15 +90,16 @@ 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, GetInterpolationQualifier(ApiType, true, true));
|
||||
GenerateVSOutputMembers<T>(out, ApiType, "in", GetInterpolationQualifier());
|
||||
out.Write("} vs[%d];\n", vertex_in);
|
||||
|
||||
out.Write("out VertexData {\n");
|
||||
GenerateVSOutputMembers<T>(out, ApiType, GetInterpolationQualifier(ApiType, false, true));
|
||||
GenerateVSOutputMembers<T>(out, ApiType, "out", GetInterpolationQualifier());
|
||||
|
||||
if (g_ActiveConfig.iStereoMode > 0)
|
||||
out.Write("\tflat int layer;\n");
|
||||
out.Write("\tflat out int layer;\n");
|
||||
|
||||
out.Write("} ps;\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue