SPIRV-Cross/reference
Bill Hollings 3105e82b2e MSL: Fix duplicate gl_Position outputs when gl_Position defined but unused.
When gl_Position is defined by SPIR-V, but neither used nor initialized,
it appeared twice in the MSL output, as gl_Position and glPosition_1.

The existing tests for whether an output is active check only that it is
used by an op, or initialized. Adding the implicit gl_Position also marked
the existing gl_Position as active, duplicating the output variable.

Fix is that when checking for the need to add an implicit gl_Position
output, also check if the var is already defined in the shader,
and just needs to be marked as active.
Add test shader.
2021-08-16 11:23:15 -04:00
..
opt MSL: Fix duplicate gl_Position outputs when gl_Position defined but unused. 2021-08-16 11:23:15 -04:00
shaders GLSL: Implement GL_EXT_ray_query. 2021-07-19 14:01:21 +02:00
shaders-hlsl HLSL: Rewrite how block IO is emitted. 2021-06-28 15:04:49 +02:00
shaders-hlsl-no-opt HLSL: Rewrite how block IO is emitted. 2021-06-28 15:04:49 +02:00
shaders-msl MSL: Fix duplicate gl_Position outputs when gl_Position defined but unused. 2021-08-16 11:23:15 -04:00
shaders-msl-no-opt MSL: Simplify spvSubgroupBallot(). 2021-07-21 00:25:09 -05:00
shaders-no-opt Handle value access in terminators. 2021-07-29 15:27:52 +02:00
shaders-reflection Parser: Don't assume OpTypePointer will always take a SPIRType. 2020-11-03 10:53:37 +01:00
shaders-ue4/asm Handle SPIR-V 1.4 selection constructs. 2021-06-28 12:23:44 +02:00
shaders-ue4-no-opt/asm Implement context-sensitive expression read tracking. 2020-06-29 12:20:35 +02:00