Place OpVariable at the beginning of the block
authorAlexander Galazin <alexander.galazin@arm.com>
Sun, 14 Oct 2018 10:45:59 +0000 (12:45 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Sun, 14 Oct 2018 10:50:31 +0000 (06:50 -0400)
SPIR-V requires that all OpVariable instructions in a function
must be in the first block in the function.

VK-GL-CTS issue: 1382

Components: Vulkan

Affects:
dEQP-VK.spirv_assembly.instruction.graphics.opspecconstantop.*
dEQP-VK.spirv_assembly.instruction.graphics.variable_init.*

Change-Id: I797e0235c4eaab4f86754bade948dc062d17ca2b

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

index 9cc06e8..8745239 100644 (file)
@@ -6328,8 +6328,8 @@ tcu::TestCaseGroup* createSpecConstantTests (tcu::TestContext& testCtx)
                "%test_code = OpFunction %v4f32 None %v4f32_v4f32_function\n"
                "%param     = OpFunctionParameter %v4f32\n"
                "%label     = OpLabel\n"
-               "${TYPE_CONVERT:opt}"
                "%result    = OpVariable %fp_v4f32 Function\n"
+               "${TYPE_CONVERT:opt}"
                "             OpStore %result %param\n"
                "%gen       = ${GEN_RESULT}\n"
                "%index     = OpIAdd %i32 %gen %c_i32_1\n"
index 0d5f725..d06bfa6 100644 (file)
@@ -203,8 +203,8 @@ void addGraphicsVariableInitPrivateTest (tcu::TestCaseGroup* group)
                "            %test_code = OpFunction %v4f32 None %v4f32_v4f32_function\n"
                "                %param = OpFunctionParameter %v4f32\n"
                "                %entry = OpLabel\n"
-               "           %outputData = OpLoad %${type} %f1\n"
                "                    %i = OpVariable %fp_i32 Function\n"
+               "           %outputData = OpLoad %${type} %f1\n"
                "                         OpStore %i %c_i32_0\n"
                "                         OpBranch %loop\n"
                "                 %loop = OpLabel\n"