Fix memory scope in OpControlBarrier tests
authorPiotr Byszewski <piotr.byszewski@mobica.com>
Wed, 27 Jan 2021 13:40:25 +0000 (14:40 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 3 Feb 2021 10:00:38 +0000 (10:00 +0000)
Workgroup Memory Scope is not allowed in TessellationControl
execution model (VUID-StandaloneSpirv-None-04639). This change
replaces Workgroup memory scope with Invocation scope.

Components: Vulkan

Affects:
dEQP-VK.spirv_assembly.instruction.graphics.barrier.*

Change-Id: Icf2e950a68528f1959a2fefd86dffdde97e150c5

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

index d953dbd..5d77233 100644 (file)
@@ -317,7 +317,7 @@ PACKAGES = [
        GitRepo(
                "https://github.com/KhronosGroup/SPIRV-Tools.git",
                None,
-               "cd590fa3341284cd6d1ee82366155786cfd44c96",
+               "e25db023c47a3aa82454f75d722e1b9840c7807f",
                "spirv-tools"),
        GitRepo(
                "https://github.com/KhronosGroup/glslang.git",
index 1ab40bf..0c52964 100644 (file)
@@ -9754,12 +9754,13 @@ tcu::TestCaseGroup* createBarrierTests(tcu::TestContext& testCtx)
        // A barrier inside a function body.
        fragments["pre_main"] =
                "%Workgroup = OpConstant %i32 2\n"
+               "%Invocation = OpConstant %i32 4\n"
                "%WorkgroupAcquireRelease = OpConstant %i32 0x108\n";
        fragments["testfun"] =
                "%test_code = OpFunction %v4f32 None %v4f32_v4f32_function\n"
                "%param1 = OpFunctionParameter %v4f32\n"
                "%label_testfun = OpLabel\n"
-               "OpControlBarrier %Workgroup %Workgroup %WorkgroupAcquireRelease\n"
+               "OpControlBarrier %Workgroup %Invocation %WorkgroupAcquireRelease\n"
                "OpReturnValue %param1\n"
                "OpFunctionEnd\n";
        addTessCtrlTest(testGroup.get(), "in_function", fragments);
@@ -9767,6 +9768,7 @@ tcu::TestCaseGroup* createBarrierTests(tcu::TestContext& testCtx)
        // Common setup code for the following tests.
        fragments["pre_main"] =
                "%Workgroup = OpConstant %i32 2\n"
+               "%Invocation = OpConstant %i32 4\n"
                "%WorkgroupAcquireRelease = OpConstant %i32 0x108\n"
                "%c_f32_5 = OpConstant %f32 5.\n";
        const string setupPercentZero =  // Begins %test_code function with code that sets %zero to 0u but cannot be optimized away.
@@ -9786,18 +9788,18 @@ tcu::TestCaseGroup* createBarrierTests(tcu::TestContext& testCtx)
 
                "%case1 = OpLabel\n"
                ";This barrier should never be executed, but its presence makes test failure more likely when there's a bug.\n"
-               "OpControlBarrier %Workgroup %Workgroup %WorkgroupAcquireRelease\n"
+               "OpControlBarrier %Workgroup %Invocation %WorkgroupAcquireRelease\n"
                "%wrong_branch_alert1 = OpVectorInsertDynamic %v4f32 %param1 %c_f32_0_5 %c_i32_0\n"
                "OpBranch %switch_exit\n"
 
                "%switch_default = OpLabel\n"
                "%wrong_branch_alert2 = OpVectorInsertDynamic %v4f32 %param1 %c_f32_0_5 %c_i32_0\n"
                ";This barrier should never be executed, but its presence makes test failure more likely when there's a bug.\n"
-               "OpControlBarrier %Workgroup %Workgroup %WorkgroupAcquireRelease\n"
+               "OpControlBarrier %Workgroup %Invocation %WorkgroupAcquireRelease\n"
                "OpBranch %switch_exit\n"
 
                "%case0 = OpLabel\n"
-               "OpControlBarrier %Workgroup %Workgroup %WorkgroupAcquireRelease\n"
+               "OpControlBarrier %Workgroup %Invocation %WorkgroupAcquireRelease\n"
                "OpBranch %switch_exit\n"
 
                "%switch_exit = OpLabel\n"
@@ -9815,12 +9817,12 @@ tcu::TestCaseGroup* createBarrierTests(tcu::TestContext& testCtx)
 
                "%else = OpLabel\n"
                ";This barrier should never be executed, but its presence makes test failure more likely when there's a bug.\n"
-               "OpControlBarrier %Workgroup %Workgroup %WorkgroupAcquireRelease\n"
+               "OpControlBarrier %Workgroup %Invocation %WorkgroupAcquireRelease\n"
                "%wrong_branch_alert = OpVectorInsertDynamic %v4f32 %param1 %c_f32_0_5 %c_i32_0\n"
                "OpBranch %exit\n"
 
                "%then = OpLabel\n"
-               "OpControlBarrier %Workgroup %Workgroup %WorkgroupAcquireRelease\n"
+               "OpControlBarrier %Workgroup %Invocation %WorkgroupAcquireRelease\n"
                "OpBranch %exit\n"
                "%exit = OpLabel\n"
                "%ret = OpPhi %v4f32 %param1 %then %wrong_branch_alert %else\n"
@@ -9847,7 +9849,7 @@ tcu::TestCaseGroup* createBarrierTests(tcu::TestContext& testCtx)
 
                "%exit = OpLabel\n"
                "%val = OpPhi %f32 %val0 %else %val1 %then\n"
-               "OpControlBarrier %Workgroup %Workgroup %WorkgroupAcquireRelease\n"
+               "OpControlBarrier %Workgroup %Invocation %WorkgroupAcquireRelease\n"
                "%ret = OpVectorInsertDynamic %v4f32 %param1 %val %zero\n"
                "OpReturnValue %ret\n"
                "OpFunctionEnd\n";
@@ -9856,6 +9858,7 @@ tcu::TestCaseGroup* createBarrierTests(tcu::TestContext& testCtx)
        // A barrier inside a loop.
        fragments["pre_main"] =
                "%Workgroup = OpConstant %i32 2\n"
+               "%Invocation = OpConstant %i32 4\n"
                "%WorkgroupAcquireRelease = OpConstant %i32 0x108\n"
                "%c_f32_10 = OpConstant %f32 10.\n";
        fragments["testfun"] =
@@ -9869,7 +9872,7 @@ tcu::TestCaseGroup* createBarrierTests(tcu::TestContext& testCtx)
                "%loop = OpLabel\n"
                "%count = OpPhi %i32 %c_i32_4 %entry %count__ %loop\n"
                "%val1 = OpPhi %f32 %val0 %entry %val %loop\n"
-               "OpControlBarrier %Workgroup %Workgroup %WorkgroupAcquireRelease\n"
+               "OpControlBarrier %Workgroup %Invocation %WorkgroupAcquireRelease\n"
                "%fcount = OpConvertSToF %f32 %count\n"
                "%val = OpFAdd %f32 %val1 %fcount\n"
                "%count__ = OpISub %i32 %count %c_i32_1\n"