Files
wgpu/tests/out/spv/control-flow.spvasm
T
Hans Christian Schmitz 8417f849b1 Fix GLSL output for non-fallthrough switch cases (#1310)
* Fix GLSL output for non-fallthrough switch cases

Partially reverts 02c74b5002 and
fixes #1309.

* Fix indentation of control-flow WGSL code

* Clean up glsl-out switch case fallthrough handling

Only insert a break if needed
and if a case is fallthrough, insert a comment indicating this.
2021-08-31 17:48:28 -04:00

127 lines
2.3 KiB
Plaintext

; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 63
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %41 "main" %38
OpExecutionMode %41 LocalSize 1 1 1
OpDecorate %38 BuiltIn GlobalInvocationId
%2 = OpTypeVoid
%4 = OpTypeInt 32 1
%3 = OpConstant %4 1
%5 = OpConstant %4 0
%6 = OpConstant %4 2
%7 = OpConstant %4 3
%9 = OpTypeInt 32 0
%8 = OpTypeVector %9 3
%13 = OpTypeFunction %2 %4
%19 = OpTypeFunction %2
%36 = OpTypePointer Function %4
%39 = OpTypePointer Input %8
%38 = OpVariable %39 Input
%43 = OpConstant %9 2
%44 = OpConstant %9 1
%45 = OpConstant %9 72
%46 = OpConstant %9 264
%12 = OpFunction %2 None %13
%11 = OpFunctionParameter %4
%10 = OpLabel
OpBranch %14
%14 = OpLabel
OpSelectionMerge %15 None
OpSwitch %11 %16
%16 = OpLabel
OpBranch %15
%15 = OpLabel
OpReturn
OpFunctionEnd
%18 = OpFunction %2 None %19
%17 = OpLabel
OpBranch %20
%20 = OpLabel
OpSelectionMerge %21 None
OpSwitch %5 %22 0 %23
%23 = OpLabel
OpBranch %21
%22 = OpLabel
OpBranch %21
%21 = OpLabel
OpReturn
OpFunctionEnd
%26 = OpFunction %2 None %13
%25 = OpFunctionParameter %4
%24 = OpLabel
OpBranch %27
%27 = OpLabel
OpBranch %28
%28 = OpLabel
OpLoopMerge %29 %31 None
OpBranch %30
%30 = OpLabel
OpSelectionMerge %32 None
OpSwitch %25 %33 1 %34
%34 = OpLabel
OpBranch %31
%33 = OpLabel
OpBranch %32
%32 = OpLabel
OpBranch %31
%31 = OpLabel
OpBranch %28
%29 = OpLabel
OpReturn
OpFunctionEnd
%41 = OpFunction %2 None %19
%37 = OpLabel
%35 = OpVariable %36 Function
%40 = OpLoad %8 %38
OpBranch %42
%42 = OpLabel
OpControlBarrier %43 %44 %45
OpControlBarrier %43 %43 %46
OpSelectionMerge %47 None
OpSwitch %3 %48
%48 = OpLabel
OpStore %35 %3
OpBranch %47
%47 = OpLabel
%49 = OpLoad %4 %35
OpSelectionMerge %50 None
OpSwitch %49 %51 1 %52 2 %53 3 %54 4 %55
%52 = OpLabel
OpStore %35 %5
OpBranch %50
%53 = OpLabel
OpStore %35 %3
OpBranch %50
%54 = OpLabel
OpStore %35 %6
OpBranch %55
%55 = OpLabel
OpBranch %50
%51 = OpLabel
OpStore %35 %7
OpBranch %50
%50 = OpLabel
%56 = OpLoad %4 %35
OpSelectionMerge %57 None
OpSwitch %56 %58 1 %59 2 %60 3 %61 4 %62
%59 = OpLabel
OpStore %35 %5
OpBranch %57
%60 = OpLabel
OpStore %35 %3
OpReturn
%61 = OpLabel
OpStore %35 %6
OpBranch %62
%62 = OpLabel
OpReturn
%58 = OpLabel
OpStore %35 %7
OpReturn
%57 = OpLabel
OpReturn
OpFunctionEnd