| 1 |
; SPIR-V |
| 2 |
; Version: 1.3 |
| 3 |
; Generator: Khronos SPIR-V Tools Assembler; 0 |
| 4 |
; Bound: 65 |
| 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 %gl_LocalInvocationID |
| 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 %buf "buf" |
| 21 |
OpName %cb "cb" |
| 22 |
OpName %select_buffer "select_buffer" |
| 23 |
OpName %select_input "select_input" |
| 24 |
OpName %a "a" |
| 25 |
OpMemberDecorate %foo 0 Offset 0 |
| 26 |
OpMemberDecorate %foo 1 Offset 512 |
| 27 |
OpMemberDecorate %foo 2 Offset 520 |
| 28 |
OpMemberDecorate %bar 0 Offset 0 |
| 29 |
OpDecorate %foo Block |
| 30 |
OpDecorate %bar Block |
| 31 |
OpDecorate %buf DescriptorSet 0 |
| 32 |
OpDecorate %buf Binding 0 |
| 33 |
OpDecorate %cb DescriptorSet 0 |
| 34 |
OpDecorate %cb Binding 1 |
| 35 |
OpDecorate %_ptr_StorageBuffer_int ArrayStride 4 |
| 36 |
OpDecorate %_arr_int_uint_128 ArrayStride 4 |
| 37 |
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId |
| 38 |
OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId |
| 39 |
%void = OpTypeVoid |
| 40 |
%15 = OpTypeFunction %void |
| 41 |
%int = OpTypeInt 32 1 |
| 42 |
%uint = OpTypeInt 32 0 |
| 43 |
%v3uint = OpTypeVector %uint 3 |
| 44 |
%_ptr_Input_v3uint = OpTypePointer Input %v3uint |
| 45 |
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input |
| 46 |
%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input |
| 47 |
%uint_128 = OpConstant %uint 128 |
| 48 |
%_arr_int_uint_128 = OpTypeArray %int %uint_128 |
| 49 |
%float = OpTypeFloat 32 |
| 50 |
%v2float = OpTypeVector %float 2 |
| 51 |
%foo = OpTypeStruct %_arr_int_uint_128 %uint %v2float |
| 52 |
%_ptr_StorageBuffer_foo = OpTypePointer StorageBuffer %foo |
| 53 |
%buf = OpVariable %_ptr_StorageBuffer_foo StorageBuffer |
| 54 |
%bar = OpTypeStruct %int |
| 55 |
%_ptr_Uniform_bar = OpTypePointer Uniform %bar |
| 56 |
%cb = OpVariable %_ptr_Uniform_bar Uniform |
| 57 |
%uint_0 = OpConstant %uint 0 |
| 58 |
%bool = OpTypeBool |
| 59 |
%_ptr_Uniform_int = OpTypePointer Uniform %int |
| 60 |
%28 = OpTypeFunction %_ptr_StorageBuffer_foo %_ptr_StorageBuffer_foo |
| 61 |
%int_0 = OpConstant %int 0 |
| 62 |
%uint_1 = OpConstant %uint 1 |
| 63 |
%31 = OpConstantNull %_ptr_StorageBuffer_foo |
| 64 |
%32 = OpTypeFunction %_ptr_Input_v3uint |
| 65 |
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| 66 |
%_ptr_Function__ptr_StorageBuffer_foo = OpTypePointer Function %_ptr_StorageBuffer_foo |
| 67 |
%select_buffer = OpFunction %_ptr_StorageBuffer_foo None %28 |
| 68 |
%a = OpFunctionParameter %_ptr_StorageBuffer_foo |
| 69 |
%33 = OpLabel |
| 70 |
%34 = OpAccessChain %_ptr_Uniform_int %cb %uint_0 |
| 71 |
%35 = OpLoad %int %34 |
| 72 |
%36 = OpINotEqual %bool %35 %int_0 |
| 73 |
%37 = OpSelect %_ptr_StorageBuffer_foo %36 %a %31 |
| 74 |
OpReturnValue %37 |
| 75 |
OpFunctionEnd |
| 76 |
%select_input = OpFunction %_ptr_Input_v3uint None %32 |
| 77 |
%38 = OpLabel |
| 78 |
%39 = OpAccessChain %_ptr_Uniform_int %cb %uint_0 |
| 79 |
%40 = OpLoad %int %39 |
| 80 |
%41 = OpINotEqual %bool %40 %int_0 |
| 81 |
%42 = OpSelect %_ptr_Input_v3uint %41 %gl_GlobalInvocationID %gl_LocalInvocationID |
| 82 |
OpReturnValue %42 |
| 83 |
OpFunctionEnd |
| 84 |
%main = OpFunction %void None %15 |
| 85 |
%43 = OpLabel |
| 86 |
%65 = OpVariable %_ptr_Function__ptr_StorageBuffer_foo Function |
| 87 |
%44 = OpFunctionCall %_ptr_StorageBuffer_foo %select_buffer %buf |
| 88 |
OpStore %65 %44 |
| 89 |
%45 = OpFunctionCall %_ptr_Input_v3uint %select_input |
| 90 |
%66 = OpLoad %_ptr_StorageBuffer_foo %65 |
| 91 |
%46 = OpAccessChain %_ptr_StorageBuffer_int %66 %uint_0 %uint_0 |
| 92 |
%47 = OpAccessChain %_ptr_StorageBuffer_int %buf %uint_0 %uint_0 |
| 93 |
OpBranch %48 |
| 94 |
%48 = OpLabel |
| 95 |
%49 = OpPhi %_ptr_StorageBuffer_int %46 %43 %50 %51 |
| 96 |
%52 = OpPhi %_ptr_StorageBuffer_int %47 %43 %53 %51 |
| 97 |
%54 = OpLoad %int %49 |
| 98 |
%55 = OpLoad %int %52 |
| 99 |
%56 = OpINotEqual %bool %54 %55 |
| 100 |
OpLoopMerge %58 %51 None |
| 101 |
OpBranchConditional %56 %57 %58 |
| 102 |
%57 = OpLabel |
| 103 |
%59 = OpIAdd %int %54 %55 |
| 104 |
%60 = OpLoad %v3uint %45 |
| 105 |
%61 = OpCompositeExtract %uint %60 0 |
| 106 |
%62 = OpBitcast %int %61 |
| 107 |
%63 = OpIAdd %int %59 %62 |
| 108 |
OpStore %49 %63 |
| 109 |
OpStore %52 %63 |
| 110 |
OpBranch %51 |
| 111 |
%51 = OpLabel |
| 112 |
%50 = OpPtrAccessChain %_ptr_StorageBuffer_int %49 %uint_1 |
| 113 |
%53 = OpPtrAccessChain %_ptr_StorageBuffer_int %52 %uint_1 |
| 114 |
OpBranch %48 |
| 115 |
%58 = OpLabel |
| 116 |
OpReturn |
| 117 |
OpFunctionEnd |