Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 1 | ; SPIR-V |
| 2 | ; Version: 1.3 |
| 3 | ; Generator: Google Tint Compiler; 0 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 4 | ; Bound: 122 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 5 | ; Schema: 0 |
| 6 | OpCapability Shader |
| 7 | OpMemoryModel Logical GLSL450 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 8 | OpEntryPoint Fragment %fragment_main "fragment_main" |
| 9 | OpEntryPoint GLCompute %compute_main "compute_main" |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 10 | OpEntryPoint Vertex %vertex_main "vertex_main" %pos_1 %prevent_dce_1 %vertex_point_size |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 11 | OpExecutionMode %fragment_main OriginUpperLeft |
| 12 | OpExecutionMode %compute_main LocalSize 1 1 1 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 13 | OpName %pos_1 "pos_1" |
| 14 | OpName %prevent_dce_1 "prevent_dce_1" |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 15 | OpName %vertex_point_size "vertex_point_size" |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 16 | OpName %prevent_dce_block "prevent_dce_block" |
| 17 | OpMemberName %prevent_dce_block 0 "inner" |
| 18 | OpName %prevent_dce "prevent_dce" |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 19 | OpName %tint_count_leading_zeros "tint_count_leading_zeros" |
| 20 | OpName %v "v" |
| 21 | OpName %x "x" |
| 22 | OpName %countLeadingZeros_7c38a6 "countLeadingZeros_7c38a6" |
| 23 | OpName %arg_0 "arg_0" |
| 24 | OpName %res "res" |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 25 | OpName %fragment_main "fragment_main" |
| 26 | OpName %compute_main "compute_main" |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 27 | OpName %VertexOutput "VertexOutput" |
| 28 | OpMemberName %VertexOutput 0 "pos" |
| 29 | OpMemberName %VertexOutput 1 "prevent_dce" |
| 30 | OpName %vertex_main_inner "vertex_main_inner" |
| 31 | OpName %out "out" |
| 32 | OpName %vertex_main "vertex_main" |
| 33 | OpDecorate %pos_1 BuiltIn Position |
| 34 | OpDecorate %prevent_dce_1 Location 0 |
| 35 | OpDecorate %prevent_dce_1 Flat |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 36 | OpDecorate %vertex_point_size BuiltIn PointSize |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 37 | OpDecorate %prevent_dce_block Block |
| 38 | OpMemberDecorate %prevent_dce_block 0 Offset 0 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 39 | OpDecorate %prevent_dce DescriptorSet 0 |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 40 | OpDecorate %prevent_dce Binding 0 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 41 | OpMemberDecorate %VertexOutput 0 Offset 0 |
| 42 | OpMemberDecorate %VertexOutput 1 Offset 16 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 43 | %float = OpTypeFloat 32 |
| 44 | %v4float = OpTypeVector %float 4 |
| 45 | %_ptr_Output_v4float = OpTypePointer Output %v4float |
| 46 | %5 = OpConstantNull %v4float |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 47 | %pos_1 = OpVariable %_ptr_Output_v4float Output %5 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 48 | %int = OpTypeInt 32 1 |
| 49 | %v3int = OpTypeVector %int 3 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 50 | %_ptr_Output_v3int = OpTypePointer Output %v3int |
| 51 | %10 = OpConstantNull %v3int |
| 52 | %prevent_dce_1 = OpVariable %_ptr_Output_v3int Output %10 |
| 53 | %_ptr_Output_float = OpTypePointer Output %float |
| 54 | %13 = OpConstantNull %float |
| 55 | %vertex_point_size = OpVariable %_ptr_Output_float Output %13 |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 56 | %prevent_dce_block = OpTypeStruct %v3int |
| 57 | %_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block |
| 58 | %prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 59 | %17 = OpTypeFunction %v3int %v3int |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 60 | %uint = OpTypeInt 32 0 |
| 61 | %v3uint = OpTypeVector %uint 3 |
| 62 | %_ptr_Function_v3uint = OpTypePointer Function %v3uint |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 63 | %26 = OpConstantNull %v3uint |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 64 | %uint_65535 = OpConstant %uint 65535 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 65 | %30 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 66 | %bool = OpTypeBool |
| 67 | %v3bool = OpTypeVector %bool 3 |
| 68 | %uint_16 = OpConstant %uint 16 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 69 | %35 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 70 | %uint_16777215 = OpConstant %uint 16777215 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 71 | %41 = OpConstantComposite %v3uint %uint_16777215 %uint_16777215 %uint_16777215 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 72 | %uint_8 = OpConstant %uint 8 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 73 | %44 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 74 | %uint_268435455 = OpConstant %uint 268435455 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 75 | %50 = OpConstantComposite %v3uint %uint_268435455 %uint_268435455 %uint_268435455 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 76 | %uint_4 = OpConstant %uint 4 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 77 | %53 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 78 | %uint_1073741823 = OpConstant %uint 1073741823 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 79 | %59 = OpConstantComposite %v3uint %uint_1073741823 %uint_1073741823 %uint_1073741823 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 80 | %uint_2 = OpConstant %uint 2 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 81 | %62 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 82 | %uint_2147483647 = OpConstant %uint 2147483647 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 83 | %68 = OpConstantComposite %v3uint %uint_2147483647 %uint_2147483647 %uint_2147483647 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 84 | %uint_1 = OpConstant %uint 1 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 85 | %71 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1 |
| 86 | %81 = OpTypeFunction %v3int |
Ben Clayton | ee36e39 | 2022-07-26 14:27:25 +0000 | [diff] [blame] | 87 | %int_1 = OpConstant %int 1 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 88 | %85 = OpConstantComposite %v3int %int_1 %int_1 %int_1 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 89 | %_ptr_Function_v3int = OpTypePointer Function %v3int |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 90 | %void = OpTypeVoid |
| 91 | %92 = OpTypeFunction %void |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 92 | %uint_0 = OpConstant %uint 0 |
| 93 | %_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 94 | %VertexOutput = OpTypeStruct %v4float %v3int |
| 95 | %104 = OpTypeFunction %VertexOutput |
| 96 | %_ptr_Function_VertexOutput = OpTypePointer Function %VertexOutput |
| 97 | %110 = OpConstantNull %VertexOutput |
| 98 | %_ptr_Function_v4float = OpTypePointer Function %v4float |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 99 | %float_1 = OpConstant %float 1 |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 100 | %tint_count_leading_zeros = OpFunction %v3int None %17 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 101 | %v = OpFunctionParameter %v3int |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 102 | %20 = OpLabel |
| 103 | %x = OpVariable %_ptr_Function_v3uint Function %26 |
| 104 | %21 = OpBitcast %v3uint %v |
| 105 | OpStore %x %21 |
| 106 | %28 = OpLoad %v3uint %x |
| 107 | %31 = OpULessThanEqual %v3bool %28 %30 |
| 108 | %27 = OpSelect %v3uint %31 %35 %26 |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 109 | %36 = OpLoad %v3uint %x |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 110 | %37 = OpShiftLeftLogical %v3uint %36 %27 |
| 111 | OpStore %x %37 |
| 112 | %39 = OpLoad %v3uint %x |
| 113 | %42 = OpULessThanEqual %v3bool %39 %41 |
| 114 | %38 = OpSelect %v3uint %42 %44 %26 |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 115 | %45 = OpLoad %v3uint %x |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 116 | %46 = OpShiftLeftLogical %v3uint %45 %38 |
| 117 | OpStore %x %46 |
| 118 | %48 = OpLoad %v3uint %x |
| 119 | %51 = OpULessThanEqual %v3bool %48 %50 |
| 120 | %47 = OpSelect %v3uint %51 %53 %26 |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 121 | %54 = OpLoad %v3uint %x |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 122 | %55 = OpShiftLeftLogical %v3uint %54 %47 |
| 123 | OpStore %x %55 |
| 124 | %57 = OpLoad %v3uint %x |
| 125 | %60 = OpULessThanEqual %v3bool %57 %59 |
| 126 | %56 = OpSelect %v3uint %60 %62 %26 |
Ben Clayton | 77a90cb | 2023-03-06 18:25:08 +0000 | [diff] [blame] | 127 | %63 = OpLoad %v3uint %x |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 128 | %64 = OpShiftLeftLogical %v3uint %63 %56 |
| 129 | OpStore %x %64 |
| 130 | %66 = OpLoad %v3uint %x |
| 131 | %69 = OpULessThanEqual %v3bool %66 %68 |
| 132 | %65 = OpSelect %v3uint %69 %71 %26 |
| 133 | %73 = OpLoad %v3uint %x |
| 134 | %74 = OpIEqual %v3bool %73 %26 |
| 135 | %72 = OpSelect %v3uint %74 %71 %26 |
| 136 | %76 = OpBitwiseOr %v3uint %27 %38 |
| 137 | %77 = OpBitwiseOr %v3uint %76 %47 |
| 138 | %78 = OpBitwiseOr %v3uint %77 %56 |
| 139 | %79 = OpBitwiseOr %v3uint %78 %65 |
| 140 | %80 = OpIAdd %v3uint %79 %72 |
| 141 | %75 = OpBitcast %v3int %80 |
| 142 | OpReturnValue %75 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 143 | OpFunctionEnd |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 144 | %countLeadingZeros_7c38a6 = OpFunction %v3int None %81 |
| 145 | %83 = OpLabel |
| 146 | %arg_0 = OpVariable %_ptr_Function_v3int Function %10 |
| 147 | %res = OpVariable %_ptr_Function_v3int Function %10 |
| 148 | OpStore %arg_0 %85 |
| 149 | %89 = OpLoad %v3int %arg_0 |
| 150 | %88 = OpFunctionCall %v3int %tint_count_leading_zeros %89 |
| 151 | OpStore %res %88 |
| 152 | %91 = OpLoad %v3int %res |
| 153 | OpReturnValue %91 |
| 154 | OpFunctionEnd |
| 155 | %fragment_main = OpFunction %void None %92 |
| 156 | %95 = OpLabel |
| 157 | %98 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0 |
| 158 | %99 = OpFunctionCall %v3int %countLeadingZeros_7c38a6 |
| 159 | OpStore %98 %99 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 160 | OpReturn |
| 161 | OpFunctionEnd |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 162 | %compute_main = OpFunction %void None %92 |
| 163 | %101 = OpLabel |
| 164 | %102 = OpAccessChain %_ptr_StorageBuffer_v3int %prevent_dce %uint_0 |
| 165 | %103 = OpFunctionCall %v3int %countLeadingZeros_7c38a6 |
| 166 | OpStore %102 %103 |
| 167 | OpReturn |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 168 | OpFunctionEnd |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 169 | %vertex_main_inner = OpFunction %VertexOutput None %104 |
| 170 | %107 = OpLabel |
| 171 | %out = OpVariable %_ptr_Function_VertexOutput Function %110 |
| 172 | %112 = OpAccessChain %_ptr_Function_v4float %out %uint_0 |
| 173 | OpStore %112 %5 |
| 174 | %113 = OpAccessChain %_ptr_Function_v3int %out %uint_1 |
| 175 | %114 = OpFunctionCall %v3int %countLeadingZeros_7c38a6 |
| 176 | OpStore %113 %114 |
| 177 | %115 = OpLoad %VertexOutput %out |
| 178 | OpReturnValue %115 |
| 179 | OpFunctionEnd |
| 180 | %vertex_main = OpFunction %void None %92 |
| 181 | %117 = OpLabel |
| 182 | %118 = OpFunctionCall %VertexOutput %vertex_main_inner |
| 183 | %119 = OpCompositeExtract %v4float %118 0 |
| 184 | OpStore %pos_1 %119 |
| 185 | %120 = OpCompositeExtract %v3int %118 1 |
| 186 | OpStore %prevent_dce_1 %120 |
Ben Clayton | c0af5c5 | 2022-06-02 14:36:10 +0000 | [diff] [blame] | 187 | OpStore %vertex_point_size %float_1 |
| 188 | OpReturn |
| 189 | OpFunctionEnd |