Fix variable declaring location in SPIR-V assembly.
authorLei Zhang <antiagainst@google.com>
Wed, 30 Nov 2016 23:10:36 +0000 (18:10 -0500)
committerPyry Haulos <phaulos@google.com>
Fri, 2 Dec 2016 18:57:47 +0000 (13:57 -0500)
The spec validation rules require that all OpVariable instructions
in a function must be as the first instructions in the first block.

Change-Id: If054bd7882eaf5ffc00899fbdef9a9b71d544019

external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp

index 4a51a46..3887f80 100644 (file)
@@ -8803,12 +8803,12 @@ const string specializeDefaultOutputShaderTemplate (const NumberType type, const
                // Main function
                "%main       = OpFunction %void None %voidf\n"
                "%label      = OpLabel\n"
+               "%out_var    = OpVariable %var_ptr Function ${variableInitializer}\n"
                "%idval      = OpLoad %uvec3 %id\n"
                "%x          = OpCompositeExtract %u32 %idval 0\n"
                "%inloc      = OpAccessChain %in_ptr %indata %zero %x\n"
                "%outloc     = OpAccessChain %in_ptr %outdata %zero %x\n"
 
-               "%out_var    = OpVariable %var_ptr Function ${variableInitializer}\n"
                "%outval     = OpLoad %in_type %out_var\n"
                "              OpStore %outloc %outval\n"
                "              OpReturn\n"