| 1 |
; SPIR-V |
| 2 |
; Version: 1.3 |
| 3 |
; Generator: Khronos SPIR-V Tools Assembler; 0 |
| 4 |
; Bound: 89 |
| 5 |
; Schema: 0 |
| 6 |
OpCapability Shader |
| 7 |
OpCapability VariablePointers |
| 8 |
%1 = OpExtInstImport "GLSL.std.450" |
| 9 |
OpMemoryModel Logical GLSL450 |
| 10 |
OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID |
| 11 |
OpExecutionMode %main LocalSize 1 1 1 |
| 12 |
OpSource GLSL 450 |
| 13 |
OpName %main "main" |
| 14 |
OpName %foo "foo" |
| 15 |
OpMemberName %foo 0 "a" |
| 16 |
OpMemberName %foo 1 "b" |
| 17 |
OpMemberName %foo 2 "c" |
| 18 |
OpName %bar "bar" |
| 19 |
OpMemberName %bar 0 "d" |
| 20 |
OpName %baz "baz" |
| 21 |
OpMemberName %baz 0 "e" |
| 22 |
OpName %buf "buf" |
| 23 |
OpName %buf2 "buf2" |
| 24 |
OpName %cb "cb" |
| 25 |
OpName %tgsm "tgsm" |
| 26 |
OpName %sbuf "sbuf" |
| 27 |
OpName %sbuf2 "sbuf2" |
| 28 |
OpName %stgsm "stgsm" |
| 29 |
OpName %select_buffer "select_buffer" |
| 30 |
OpName %select_buffer_null "select_buffer_null" |
| 31 |
OpName %select_tgsm "select_tgsm" |
| 32 |
OpName %cur "cur" |
| 33 |
OpMemberDecorate %foo 0 Offset 0 |
| 34 |
OpMemberDecorate %foo 1 Offset 512 |
| 35 |
OpMemberDecorate %foo 2 Offset 520 |
| 36 |
OpMemberDecorate %bar 0 Offset 0 |
| 37 |
OpMemberDecorate %baz 0 Offset 0 |
| 38 |
OpDecorate %foo Block |
| 39 |
OpDecorate %bar Block |
| 40 |
OpDecorate %baz Block |
| 41 |
OpDecorate %buf DescriptorSet 0 |
| 42 |
OpDecorate %buf Binding 0 |
| 43 |
OpDecorate %cb DescriptorSet 0 |
| 44 |
OpDecorate %cb Binding 3 |
| 45 |
OpDecorate %buf2 DescriptorSet 0 |
| 46 |
OpDecorate %buf2 Binding 4 |
| 47 |
OpDecorate %_ptr_Workgroup_int ArrayStride 4 |
| 48 |
OpDecorate %_ptr_StorageBuffer_int ArrayStride 4 |
| 49 |
OpDecorate %_arr_int_uint_128 ArrayStride 4 |
| 50 |
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId |
| 51 |
%void = OpTypeVoid |
| 52 |
%22 = OpTypeFunction %void |
| 53 |
%int = OpTypeInt 32 1 |
| 54 |
%uint = OpTypeInt 32 0 |
| 55 |
%v3uint = OpTypeVector %uint 3 |
| 56 |
%_ptr_Input_v3uint = OpTypePointer Input %v3uint |
| 57 |
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input |
| 58 |
%uint_128 = OpConstant %uint 128 |
| 59 |
%_arr_int_uint_128 = OpTypeArray %int %uint_128 |
| 60 |
%float = OpTypeFloat 32 |
| 61 |
%v2float = OpTypeVector %float 2 |
| 62 |
%foo = OpTypeStruct %_arr_int_uint_128 %uint %v2float |
| 63 |
%_ptr_StorageBuffer_foo = OpTypePointer StorageBuffer %foo |
| 64 |
%buf = OpVariable %_ptr_StorageBuffer_foo StorageBuffer |
| 65 |
%bar = OpTypeStruct %int |
| 66 |
%_ptr_Uniform_bar = OpTypePointer Uniform %bar |
| 67 |
%cb = OpVariable %_ptr_Uniform_bar Uniform |
| 68 |
%baz = OpTypeStruct %_arr_int_uint_128 |
| 69 |
%_ptr_StorageBuffer_baz = OpTypePointer StorageBuffer %baz |
| 70 |
%buf2 = OpVariable %_ptr_StorageBuffer_baz StorageBuffer |
| 71 |
%_ptr_Workgroup__arr_int_uint_128 = OpTypePointer Workgroup %_arr_int_uint_128 |
| 72 |
%tgsm = OpVariable %_ptr_Workgroup__arr_int_uint_128 Workgroup |
| 73 |
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| 74 |
%_ptr_Private__ptr_StorageBuffer_int = OpTypePointer Private %_ptr_StorageBuffer_int |
| 75 |
%sbuf = OpVariable %_ptr_Private__ptr_StorageBuffer_int Private |
| 76 |
%sbuf2 = OpVariable %_ptr_Private__ptr_StorageBuffer_int Private |
| 77 |
%_ptr_Workgroup_int = OpTypePointer Workgroup %int |
| 78 |
%_ptr_Private__ptr_Workgroup_int = OpTypePointer Private %_ptr_Workgroup_int |
| 79 |
%stgsm = OpVariable %_ptr_Private__ptr_Workgroup_int Private |
| 80 |
%uint_0 = OpConstant %uint 0 |
| 81 |
%bool = OpTypeBool |
| 82 |
%_ptr_Uniform_int = OpTypePointer Uniform %int |
| 83 |
%44 = OpTypeFunction %_ptr_StorageBuffer_int |
| 84 |
%int_0 = OpConstant %int 0 |
| 85 |
%uint_1 = OpConstant %uint 1 |
| 86 |
%47 = OpConstantNull %_ptr_StorageBuffer_int |
| 87 |
%48 = OpTypeFunction %_ptr_Workgroup_int |
| 88 |
%49 = OpConstantNull %_ptr_Workgroup_int |
| 89 |
%_ptr_Function__ptr_Workgroup_int = OpTypePointer Function %_ptr_Workgroup_int |
| 90 |
%select_buffer = OpFunction %_ptr_StorageBuffer_int None %44 |
| 91 |
%51 = OpLabel |
| 92 |
%52 = OpAccessChain %_ptr_Uniform_int %cb %uint_0 |
| 93 |
%53 = OpLoad %int %52 |
| 94 |
%54 = OpINotEqual %bool %53 %int_0 |
| 95 |
%55 = OpAccessChain %_ptr_StorageBuffer_int %buf %uint_0 %uint_0 |
| 96 |
%56 = OpAccessChain %_ptr_StorageBuffer_int %buf2 %uint_0 %uint_0 |
| 97 |
%57 = OpSelect %_ptr_StorageBuffer_int %54 %55 %56 |
| 98 |
OpReturnValue %57 |
| 99 |
OpFunctionEnd |
| 100 |
%select_buffer_null = OpFunction %_ptr_StorageBuffer_int None %44 |
| 101 |
%58 = OpLabel |
| 102 |
%59 = OpAccessChain %_ptr_Uniform_int %cb %uint_0 |
| 103 |
%60 = OpLoad %int %59 |
| 104 |
%61 = OpINotEqual %bool %60 %int_0 |
| 105 |
%62 = OpAccessChain %_ptr_StorageBuffer_int %buf %uint_0 %uint_0 |
| 106 |
%63 = OpSelect %_ptr_StorageBuffer_int %61 %62 %47 |
| 107 |
OpReturnValue %63 |
| 108 |
OpFunctionEnd |
| 109 |
%select_tgsm = OpFunction %_ptr_Workgroup_int None %48 |
| 110 |
%64 = OpLabel |
| 111 |
%65 = OpAccessChain %_ptr_Uniform_int %cb %uint_0 |
| 112 |
%66 = OpLoad %int %65 |
| 113 |
%67 = OpINotEqual %bool %66 %int_0 |
| 114 |
%68 = OpAccessChain %_ptr_Workgroup_int %tgsm %uint_0 |
| 115 |
%69 = OpSelect %_ptr_Workgroup_int %67 %68 %49 |
| 116 |
OpReturnValue %69 |
| 117 |
OpFunctionEnd |
| 118 |
%main = OpFunction %void None %22 |
| 119 |
%70 = OpLabel |
| 120 |
%cur = OpVariable %_ptr_Function__ptr_Workgroup_int Function |
| 121 |
%71 = OpFunctionCall %_ptr_StorageBuffer_int %select_buffer |
| 122 |
OpStore %sbuf %71 |
| 123 |
%72 = OpFunctionCall %_ptr_StorageBuffer_int %select_buffer_null |
| 124 |
OpStore %sbuf2 %72 |
| 125 |
%73 = OpFunctionCall %_ptr_Workgroup_int %select_tgsm |
| 126 |
OpStore %stgsm %73 |
| 127 |
%74 = OpAccessChain %_ptr_StorageBuffer_int %buf %uint_0 %uint_0 |
| 128 |
%75 = OpLoad %_ptr_Workgroup_int %stgsm |
| 129 |
%76 = OpCopyObject %_ptr_Workgroup_int %75 |
| 130 |
OpStore %cur %76 |
| 131 |
OpBranch %77 |
| 132 |
%77 = OpLabel |
| 133 |
%78 = OpPhi %_ptr_StorageBuffer_int %74 %70 %79 %80 |
| 134 |
%81 = OpLoad %_ptr_Workgroup_int %cur |
| 135 |
%82 = OpLoad %int %78 |
| 136 |
%83 = OpINotEqual %bool %82 %int_0 |
| 137 |
OpLoopMerge %85 %80 None |
| 138 |
OpBranchConditional %83 %84 %85 |
| 139 |
%84 = OpLabel |
| 140 |
%86 = OpLoad %int %81 |
| 141 |
%87 = OpIAdd %int %82 %86 |
| 142 |
OpStore %78 %87 |
| 143 |
OpStore %81 %87 |
| 144 |
OpBranch %80 |
| 145 |
%80 = OpLabel |
| 146 |
%79 = OpPtrAccessChain %_ptr_StorageBuffer_int %78 %uint_1 |
| 147 |
%88 = OpPtrAccessChain %_ptr_Workgroup_int %81 %uint_1 |
| 148 |
OpStore %cur %88 |
| 149 |
OpBranch %77 |
| 150 |
%85 = OpLabel |
| 151 |
OpReturn |
| 152 |
OpFunctionEnd |