Merge pull request #415 from KhronosGroup/fix-temp-decl-order
Need to sort declared temporaries to ensure stable output.
This commit is contained in:
commit
ab3907e4b5
@ -22,9 +22,9 @@ kernel void main0(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], devic
|
||||
int _94;
|
||||
_93 = _24.in_data[gl_GlobalInvocationID.x];
|
||||
_94 = 0;
|
||||
int _48;
|
||||
int _40;
|
||||
float4 _46;
|
||||
int _48;
|
||||
for (;;)
|
||||
{
|
||||
_40 = _94 + 1;
|
||||
|
@ -20,9 +20,9 @@ void main()
|
||||
int _94;
|
||||
_93 = _24.in_data[gl_GlobalInvocationID.x];
|
||||
_94 = 0;
|
||||
int _48;
|
||||
int _40;
|
||||
vec4 _46;
|
||||
int _48;
|
||||
for (;;)
|
||||
{
|
||||
_40 = _94 + 1;
|
||||
|
@ -8265,6 +8265,10 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
|
||||
bool emitted_for_loop_header = false;
|
||||
|
||||
// If we need to force temporaries for certain IDs due to continue blocks, do it before starting loop header.
|
||||
// Need to sort these to ensure that reference output is stable.
|
||||
sort(begin(block.declare_temporary), end(block.declare_temporary),
|
||||
[](const pair<uint32_t, uint32_t> &a, const pair<uint32_t, uint32_t> &b) { return a.second < b.second; });
|
||||
|
||||
for (auto &tmp : block.declare_temporary)
|
||||
{
|
||||
auto flags = meta[tmp.second].decoration.decoration_flags;
|
||||
|
Loading…
Reference in New Issue
Block a user