mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-23 11:19:40 +00:00
1326b8c754
Append() method is special: unlike most outputs, it does not copy some temporary data to a symbol in the entry point epilogue, but rather uses an emit builtin after each write to the output stream. This had been handled by remembering the special output symbol for the stream as it was declared in the shader entry point before symbol sanitization. However the prior code was too simple and only handled cases where the Append() method happened after the entry point, so that the output symbol had been seen. This PR adds a patching step so that the Append()s may appear in any order WRT the entry point. They are patched in an epilogue, whereupon it is guaranteed in a well formed shader that we have seen the appropriate declaration. Fixes #1217.
19 lines
450 B
GLSL
19 lines
450 B
GLSL
struct GSPS_INPUT
|
|
{
|
|
};
|
|
|
|
// Test Append() method appearing before declaration of entry point's stream output.
|
|
|
|
void EmitVertex(in GSPS_INPUT output, inout TriangleStream<GSPS_INPUT> TriStream)
|
|
{
|
|
TriStream.Append( output );
|
|
}
|
|
|
|
[maxvertexcount(3)]
|
|
void main( triangle GSPS_INPUT input[3], inout TriangleStream<GSPS_INPUT> TriStream )
|
|
{
|
|
EmitVertex(input[0], TriStream);
|
|
EmitVertex(input[1], TriStream);
|
|
EmitVertex(input[2], TriStream);
|
|
}
|