Fix control flow in SPIR-V test cases
authorAlan Baker <alanbaker@google.com>
Mon, 13 Jun 2022 13:06:25 +0000 (09:06 -0400)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 15 Jul 2022 14:26:28 +0000 (14:26 +0000)
Adapts three graphicsfuzz test cases to reflect changes in the SPIR-V
specification that tighten the rules for structured control flow.

Component: Vulkan

VK-GL-CTS Issue: 3612, 3613, 3615

Affected tests:
dEQP-VK.graphicsfuzz.control-flow-switch
dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
dEQP-VK.graphicsfuzz.nested-for-loops-with-return

Change-Id: I3b581dcdc685717421c7c7a7299bf378b3cc3b01

external/vulkancts/data/vulkan/amber/graphicsfuzz/control-flow-switch.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/cov-dead-branch-func-return-arg.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/nested-for-loops-with-return.amber

index 6f9dbaa..3393d1b 100644 (file)
@@ -89,7 +89,7 @@ SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos SPIR-V Tools Assembler; 0
-; Bound: 72
+; Bound: 73
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
@@ -153,20 +153,22 @@ SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
                OpLoopMerge %40 %41 None
                OpBranch %42
          %42 = OpLabel
-         %43 = OpPhi %8 %28 %39 %44 %45
-         %46 = OpPhi %11 %12 %39 %47 %45
+         %43 = OpPhi %8 %28 %39 %44 %72
+         %46 = OpPhi %11 %12 %39 %47 %72
          %48 = OpSLessThan %8 %46 %13
-               OpLoopMerge %49 %45 None
+               OpLoopMerge %49 %72 None
                OpBranchConditional %48 %50 %49
          %50 = OpLabel
          %51 = OpConvertFToS %11 %35
                OpSelectionMerge %52 None
                OpSwitch %51 %45 9 %53 42 %54
          %52 = OpLabel
-               OpBranch %45
+               OpBranch %72
          %45 = OpLabel
-         %44 = OpPhi %8 %43 %50 %55 %56 %27 %52
+         %44 = OpPhi %8 %43 %50 %55 %56
          %47 = OpIAdd %11 %46 %13
+               OpBranch %72
+         %72 = OpLabel
                OpBranch %42
          %53 = OpLabel
                OpBranch %54
index 3c2f4f0..66fc691 100644 (file)
@@ -93,7 +93,7 @@ SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 8
-; Bound: 126
+; Bound: 127
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
@@ -150,7 +150,7 @@ SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
          %42 = OpLoad %6 %36
                OpStore %41 %42
                OpStore %74 %68
-               OpLoopMerge %39 %37 None
+               OpLoopMerge %39 %126 None
                OpBranch %78
          %78 = OpLabel
          %79 = OpLoad %6 %41
@@ -244,7 +244,9 @@ SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
          %47 = OpFAdd %6 %46 %125
                OpStore %36 %47
          %50 = OpFOrdLessThan %20 %47 %49
-               OpBranchConditional %50 %37 %39
+               OpBranchConditional %50 %126 %39
+        %126 = OpLabel
+               OpBranch %37
          %39 = OpLabel
          %51 = OpLoad %6 %35
          %53 = OpFOrdEqual %20 %51 %52
index ab0ad54..97f8be1 100644 (file)
@@ -87,7 +87,7 @@ SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 65
+; Bound: 66
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
@@ -164,8 +164,10 @@ SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
                OpBranch %32
          %32 = OpLabel
          %39 = OpSLessThan %14 %22 %38
-               OpLoopMerge %34 %35 None
+               OpLoopMerge %65 %35 None
                OpBranch %33
+         %65 = OpLabel
+               OpBranch %34
          %33 = OpLabel
                OpReturnValue %12
          %35 = OpLabel