Fix invalid SPIR-V in GraphicsFuzz tests
authorAlastair Donaldson <afdx@google.com>
Tue, 26 Nov 2019 14:17:11 +0000 (14:17 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 17 Dec 2019 10:21:48 +0000 (05:21 -0500)
Components: Vulkan

VK-GL-CTS Issue: 2122

Affected tests:

dEQP-VK.graphicsfuzz.continue-and-merge
dEQP-VK.graphicsfuzz.control-flow-switch
dEQP-VK.graphicsfuzz.discard-continue-return
dEQP-VK.graphicsfuzz.fragcoord-control-flow-2
dEQP-VK.graphicsfuzz.fragcoord-control-flow
dEQP-VK.graphicsfuzz.loop-call-discard
dEQP-VK.graphicsfuzz.mat-array-deep-control-flow
dEQP-VK.graphicsfuzz.mat-array-distance
dEQP-VK.graphicsfuzz.return-in-loop-in-function
dEQP-VK.graphicsfuzz.unreachable-continue-statement

Change-Id: Iaa7448ee4a815d9e3a1c8a5582214ecd599ac143

external/vulkancts/data/vulkan/amber/graphicsfuzz/continue-and-merge.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/control-flow-switch.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/discard-continue-return.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/fragcoord-control-flow-2.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/fragcoord-control-flow.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/loop-call-discard.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/mat-array-deep-control-flow.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/mat-array-distance.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/return-in-loop-in-function.amber
external/vulkancts/data/vulkan/amber/graphicsfuzz/unreachable-continue-statement.amber

index 8e49dd8..4eae650 100644 (file)
          %42 = OpLabel
                OpLoopMerge %47 %45 None
                OpBranchConditional %false %49 %47
-            %49 = OpLabel
-                  OpLoopMerge %45 %52 None
-                  OpBranchConditional %false %45 %45
-                %52 = OpLabel
-                      OpBranch %49
-            %45 = OpLabel
-                  OpBranch %42
+         %49 = OpLabel
+               OpLoopMerge %50 %52 None
+               OpBranchConditional %false %50 %50
+         %52 = OpLabel
+               OpBranch %49
+         %50 = OpLabel
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %42
          %47 = OpLabel
                OpStore %_GLF_color %red
                OpReturn
index efc9bb1..113ac09 100644 (file)
@@ -86,7 +86,7 @@
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 195
+; Bound: 196
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
                OpBranchConditional %150 %151 %146
         %151 = OpLabel
         %154 = OpConvertFToS %int %124
-               OpSelectionMerge %156 None
+               OpSelectionMerge %195 None
                OpSwitch %154 %156 9 %157 42 %158
+        %195 = OpLabel
+               OpBranch %156
         %156 = OpLabel
-        %194 = OpPhi %bool %179 %151 %178 %166
+        %194 = OpPhi %bool %179 %151 %178 %166 %false %195
         %169 = OpIAdd %int %177 %int_1
                OpBranch %145
         %157 = OpLabel
index 5890c99..bc71ac4 100644 (file)
@@ -65,7 +65,7 @@ SHADER fragment variant_fragment_shader SPIRV-ASM
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 95
+; Bound: 96
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
@@ -129,10 +129,12 @@ SHADER fragment variant_fragment_shader SPIRV-ASM
          %84 = OpAccessChain %36 %32 %34 %35
          %85 = OpLoad %6 %84
          %86 = OpFOrdGreaterThan %24 %28 %85
-               OpSelectionMerge %87 None
+               OpSelectionMerge %95 None
                OpBranchConditional %86 %88 %87
          %88 = OpLabel
                OpKill
+         %95 = OpLabel
+              OpBranch %87
          %87 = OpLabel
                OpBranchConditional %46 %75 %76
          %82 = OpLabel
index cfcb9fb..baa82c9 100644 (file)
@@ -57,7 +57,7 @@
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 96
+; Bound: 98
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
          %32 = OpLoad %float %31
          %33 = OpConvertFToS %int %32
          %35 = OpSLessThan %bool %33 %int_10000000
-               OpSelectionMerge %37 None
+               OpSelectionMerge %96 None
                OpBranchConditional %35 %36 %38
          %36 = OpLabel
                OpBranch %37
          %54 = OpLabel
          %89 = OpPhi %int %int_0 %47 %62 %55
          %60 = OpSLessThan %bool %89 %int_1
-               OpLoopMerge %56 %55 None
-               OpBranchConditional %60 %55 %56
+               OpLoopMerge %97 %55 None
+               OpBranchConditional %60 %55 %97
          %55 = OpLabel
                OpStore %_GLF_color %12
          %62 = OpIAdd %int %89 %int_1
                OpBranch %54
+         %97 = OpLabel
+               OpBranch %56
          %56 = OpLabel
          %64 = OpIAdd %int %83 %int_1
                OpBranch %46
                OpKill
          %44 = OpLabel
                OpBranch %37
+         %96 = OpLabel
+               OpBranch %37
          %37 = OpLabel
-         %95 = OpPhi %v4float %87 %36 %85 %44
+         %95 = OpPhi %v4float %87 %36 %85 %44 %88 %96
          %81 = OpIAdd %int %82 %int_1
                OpBranch %17
          %19 = OpLabel
index b7fb85c..4539440 100644 (file)
@@ -85,7 +85,7 @@
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 201
+; Bound: 206
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
                OpBranch %19
          %35 = OpLabel
          %39 = OpFOrdLessThan %bool %32 %float_0
-               OpSelectionMerge %41 None
+               OpSelectionMerge %201 None
                OpBranchConditional %39 %40 %41
          %40 = OpLabel
                OpBranch %19
+        %201 = OpLabel
+               OpBranch %41
          %41 = OpLabel
          %44 = OpIAdd %int %167 %int_1
                OpBranch %17
          %49 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_0
          %50 = OpLoad %float %49
          %52 = OpFOrdLessThan %bool %50 %float_40
-               OpSelectionMerge %53 None
+               OpSelectionMerge %202 None
                OpBranchConditional %52 %53 %55
+        %202 = OpLabel
+               OpBranch %53
          %53 = OpLabel
                OpStore %_GLF_color %12
                OpBranchConditional %false %45 %47
                OpBranchConditional %70 %65 %66
          %65 = OpLabel
          %74 = OpFOrdLessThan %bool %50 %float_160
-               OpSelectionMerge %76 None
+               OpSelectionMerge %203 None
                OpBranchConditional %74 %75 %94
          %75 = OpLabel
                OpBranch %78
          %86 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
          %87 = OpLoad %float %86
          %88 = OpFOrdLessThan %bool %87 %float_0
-               OpSelectionMerge %90 None
+               OpSelectionMerge %204 None
                OpBranchConditional %88 %89 %91
          %89 = OpLabel
                OpBranch %90
          %91 = OpLabel
                OpStore %_GLF_color %12
                OpBranch %90
+        %204 = OpLabel
+               OpBranch %90
          %90 = OpLabel
          %93 = OpISub %int %185 %int_1
                OpBranch %78
         %126 = OpLabel
         %182 = OpPhi %int %int_0 %119 %134 %127
         %132 = OpSLessThan %bool %182 %int_1
-               OpLoopMerge %128 %127 None
-               OpBranchConditional %132 %127 %128
+               OpLoopMerge %205 %127 None
+               OpBranchConditional %132 %127 %205
         %127 = OpLabel
                OpStore %_GLF_color %12
         %134 = OpIAdd %int %182 %int_1
                OpBranch %126
+        %205 = OpLabel
+               OpBranch %128
         %128 = OpLabel
         %136 = OpIAdd %int %172 %int_1
                OpBranch %118
         %100 = OpLabel
         %200 = OpPhi %v4float %176 %104 %174 %116
                OpBranch %76
+        %203 = OpLabel
+               OpBranch %76
          %76 = OpLabel
-        %197 = OpPhi %v4float %176 %80 %200 %100
+        %197 = OpPhi %v4float %176 %80 %200 %100 %181 %203
         %153 = OpISub %int %171 %int_1
                OpBranch %64
          %66 = OpLabel
index fc164a5..59f7850 100644 (file)
@@ -113,7 +113,7 @@ SHADER fragment variant_fragment_shader SPIRV-ASM
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 267
+; Bound: 270
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
@@ -209,8 +209,8 @@ SHADER fragment variant_fragment_shader SPIRV-ASM
         %246 = OpPhi %6 %247 %117 %264 %139
         %241 = OpPhi %11 %14 %117 %142 %139
         %126 = OpSLessThan %24 %241 %111
-               OpLoopMerge %122 %139 None
-               OpBranchConditional %126 %121 %122
+               OpLoopMerge %267 %139 None
+               OpBranchConditional %126 %121 %267
         %121 = OpLabel
         %128 = OpIMul %11 %111 %241
         %130 = OpIAdd %11 %128 %240
@@ -258,10 +258,12 @@ SHADER fragment variant_fragment_shader SPIRV-ASM
         %217 = OpAccessChain %20 %17 %58
         %218 = OpLoad %6 %217
         %219 = OpFOrdLessThan %24 %218 %23
-               OpSelectionMerge %220 None
+               OpSelectionMerge %269 None
                OpBranchConditional %219 %221 %220
         %221 = OpLabel
                OpKill
+        %269 = OpLabel
+               OpBranch %220
         %220 = OpLabel
         %224 = OpFMul %6 %78 %249
         %225 = OpFAdd %6 %224 %28
@@ -283,13 +285,17 @@ SHADER fragment variant_fragment_shader SPIRV-ASM
         %135 = OpAccessChain %59 %57 %14 %19
         %136 = OpLoad %6 %135
         %137 = OpFOrdGreaterThan %24 %114 %136
-               OpSelectionMerge %139 None
+               OpSelectionMerge %268 None
                OpBranchConditional %137 %138 %139
         %138 = OpLabel
                OpKill
+        %268 = OpLabel
+               OpBranch %139
         %139 = OpLabel
         %142 = OpIAdd %11 %241 %84
                OpBranch %120
+        %267 = OpLabel
+               OpBranch %122
         %122 = OpLabel
         %144 = OpIAdd %11 %240 %84
                OpBranch %105
index a5d60e5..ef6c7d4 100644 (file)
@@ -60,7 +60,7 @@
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 104
+; Bound: 106
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
          %60 = OpLabel
          %99 = OpPhi %int %int_0 %52 %88 %86
          %66 = OpSLessThan %bool %99 %int_4
-               OpLoopMerge %62 %86 None
-               OpBranchConditional %66 %61 %62
+               OpLoopMerge %104 %86 None
+               OpBranchConditional %66 %61 %104
          %61 = OpLabel
          %74 = OpSelect %int %66 %int_1 %int_0
          %78 = OpAccessChain %_ptr_Function_float %m %74 %98 %uint_3
          %81 = OpFDiv %v2float %70 %80
          %83 = OpExtInst %float %1 Distance %70 %81
          %84 = OpFOrdLessThan %bool %83 %float_1
-               OpSelectionMerge %86 None
+               OpSelectionMerge %105 None
                OpBranchConditional %84 %85 %86
          %85 = OpLabel
                OpStore %_GLF_color %36
                OpBranch %86
+        %105 = OpLabel
+               OpBranch %86
          %86 = OpLabel
          %88 = OpIAdd %int %99 %int_1
                OpBranch %60
+        %104 = OpLabel
+               OpBranch %62
          %62 = OpLabel
          %90 = OpIAdd %int %98 %int_1
                OpBranch %51
index 58e4159..a5658ef 100644 (file)
@@ -55,7 +55,7 @@
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 98
+; Bound: 100
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
          %97 = OpPhi %int %int_0 %42 %66 %81
          %96 = OpPhi %int %int_0 %42 %84 %81
          %57 = OpSLessThan %bool %96 %int_4
-               OpLoopMerge %53 %81 None
-               OpBranchConditional %57 %52 %53
+               OpLoopMerge %98 %81 None
+               OpBranchConditional %57 %52 %98
          %52 = OpLabel
          %60 = OpSGreaterThanEqual %bool %97 %int_2
                OpSelectionMerge %62 None
                OpBranchConditional %60 %61 %62
          %61 = OpLabel
-               OpBranch %53
+               OpBranch %98
          %62 = OpLabel
          %66 = OpIAdd %int %97 %int_1
          %73 = OpAccessChain %_ptr_Function_v4float %m %96 %95
          %75 = OpVectorShuffle %v2float %74 %74 0 1
          %78 = OpExtInst %float %1 Distance %76 %75
          %79 = OpFOrdLessThan %bool %78 %float_1
-               OpSelectionMerge %81 None
+               OpSelectionMerge %99 None
                OpBranchConditional %79 %80 %81
          %80 = OpLabel
                OpStore %_GLF_color %82
                OpBranch %81
+         %99 = OpLabel
+               OpBranch %81
          %81 = OpLabel
          %84 = OpIAdd %int %96 %int_1
                OpBranch %51
+         %98 = OpLabel
+               OpBranch %53
          %53 = OpLabel
          %86 = OpIAdd %int %95 %int_1
                OpBranch %41
index 40cd66c..dfd6569 100644 (file)
@@ -71,7 +71,7 @@ fbsize 256 256
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 58
+; Bound: 59
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
@@ -154,10 +154,12 @@ fbsize 256 256
          %23 = OpLoad %10 %12
          %24 = OpConvertSToF %6 %23
          %26 = OpFOrdGreaterThanEqual %21 %24 %25
-               OpSelectionMerge %28 None
+               OpSelectionMerge %58 None
                OpBranchConditional %26 %27 %28
          %27 = OpLabel
                OpReturnValue %25
+         %58 = OpLabel
+               OpBranch %28
          %28 = OpLabel
          %30 = OpLoad %10 %12
          %31 = OpIAdd %10 %30 %13
index bda5d73..8eb52cb 100644 (file)
@@ -73,7 +73,7 @@ SHADER fragment variant_fragment_shader SPIRV-ASM
 ; SPIR-V
 ; Version: 1.0
 ; Generator: Khronos Glslang Reference Front End; 7
-; Bound: 52
+; Bound: 53
 ; Schema: 0
                OpCapability Shader
           %1 = OpExtInstImport "GLSL.std.450"
@@ -143,10 +143,12 @@ SHADER fragment variant_fragment_shader SPIRV-ASM
          %41 = OpAccessChain %35 %31 %32 %34
          %42 = OpLoad %6 %41
          %43 = OpFOrdGreaterThan %26 %42 %14
-               OpSelectionMerge %45 None
+               OpSelectionMerge %52 None
                OpBranchConditional %43 %44 %45
          %44 = OpLabel
                OpBranch %45
+         %52 = OpLabel
+               OpBranch %45
          %45 = OpLabel
                OpBranch %21
          %40 = OpLabel