blob: 6b5ea93a4b9f32a2cc6db800591ca7c84cb30d5f [file] [log] [blame]
Ben Claytonc0af5c52022-06-02 14:36:10 +00001; SPIR-V
2; Version: 1.3
3; Generator: Google Tint Compiler; 0
Natalie Chouinarde9027182024-06-13 18:50:19 +00004; Bound: 122
Ben Claytonc0af5c52022-06-02 14:36:10 +00005; Schema: 0
6 OpCapability Shader
7 OpMemoryModel Logical GLSL450
Ben Claytonc0af5c52022-06-02 14:36:10 +00008 OpEntryPoint Fragment %fragment_main "fragment_main"
9 OpEntryPoint GLCompute %compute_main "compute_main"
Natalie Chouinarde9027182024-06-13 18:50:19 +000010 OpEntryPoint Vertex %vertex_main "vertex_main" %pos_1 %prevent_dce_1 %vertex_point_size
Ben Claytonc0af5c52022-06-02 14:36:10 +000011 OpExecutionMode %fragment_main OriginUpperLeft
12 OpExecutionMode %compute_main LocalSize 1 1 1
Natalie Chouinarde9027182024-06-13 18:50:19 +000013 OpName %pos_1 "pos_1"
14 OpName %prevent_dce_1 "prevent_dce_1"
Ben Claytonc0af5c52022-06-02 14:36:10 +000015 OpName %vertex_point_size "vertex_point_size"
Ben Clayton77a90cb2023-03-06 18:25:08 +000016 OpName %prevent_dce_block "prevent_dce_block"
17 OpMemberName %prevent_dce_block 0 "inner"
18 OpName %prevent_dce "prevent_dce"
Ben Claytonc0af5c52022-06-02 14:36:10 +000019 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 Claytonc0af5c52022-06-02 14:36:10 +000025 OpName %fragment_main "fragment_main"
26 OpName %compute_main "compute_main"
Natalie Chouinarde9027182024-06-13 18:50:19 +000027 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 Claytonc0af5c52022-06-02 14:36:10 +000036 OpDecorate %vertex_point_size BuiltIn PointSize
Ben Clayton77a90cb2023-03-06 18:25:08 +000037 OpDecorate %prevent_dce_block Block
38 OpMemberDecorate %prevent_dce_block 0 Offset 0
Natalie Chouinarde9027182024-06-13 18:50:19 +000039 OpDecorate %prevent_dce DescriptorSet 0
Ben Clayton77a90cb2023-03-06 18:25:08 +000040 OpDecorate %prevent_dce Binding 0
Natalie Chouinarde9027182024-06-13 18:50:19 +000041 OpMemberDecorate %VertexOutput 0 Offset 0
42 OpMemberDecorate %VertexOutput 1 Offset 16
Ben Claytonc0af5c52022-06-02 14:36:10 +000043 %float = OpTypeFloat 32
44 %v4float = OpTypeVector %float 4
45%_ptr_Output_v4float = OpTypePointer Output %v4float
46 %5 = OpConstantNull %v4float
Natalie Chouinarde9027182024-06-13 18:50:19 +000047 %pos_1 = OpVariable %_ptr_Output_v4float Output %5
Ben Claytonc0af5c52022-06-02 14:36:10 +000048 %int = OpTypeInt 32 1
49 %v3int = OpTypeVector %int 3
Natalie Chouinarde9027182024-06-13 18:50:19 +000050%_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 Clayton77a90cb2023-03-06 18:25:08 +000056%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 Chouinarde9027182024-06-13 18:50:19 +000059 %17 = OpTypeFunction %v3int %v3int
Ben Claytonc0af5c52022-06-02 14:36:10 +000060 %uint = OpTypeInt 32 0
61 %v3uint = OpTypeVector %uint 3
62%_ptr_Function_v3uint = OpTypePointer Function %v3uint
Natalie Chouinarde9027182024-06-13 18:50:19 +000063 %26 = OpConstantNull %v3uint
Ben Claytonc0af5c52022-06-02 14:36:10 +000064 %uint_65535 = OpConstant %uint 65535
Natalie Chouinarde9027182024-06-13 18:50:19 +000065 %30 = OpConstantComposite %v3uint %uint_65535 %uint_65535 %uint_65535
Ben Claytonc0af5c52022-06-02 14:36:10 +000066 %bool = OpTypeBool
67 %v3bool = OpTypeVector %bool 3
68 %uint_16 = OpConstant %uint 16
Natalie Chouinarde9027182024-06-13 18:50:19 +000069 %35 = OpConstantComposite %v3uint %uint_16 %uint_16 %uint_16
Ben Claytonc0af5c52022-06-02 14:36:10 +000070%uint_16777215 = OpConstant %uint 16777215
Natalie Chouinarde9027182024-06-13 18:50:19 +000071 %41 = OpConstantComposite %v3uint %uint_16777215 %uint_16777215 %uint_16777215
Ben Claytonc0af5c52022-06-02 14:36:10 +000072 %uint_8 = OpConstant %uint 8
Natalie Chouinarde9027182024-06-13 18:50:19 +000073 %44 = OpConstantComposite %v3uint %uint_8 %uint_8 %uint_8
Ben Claytonc0af5c52022-06-02 14:36:10 +000074%uint_268435455 = OpConstant %uint 268435455
Natalie Chouinarde9027182024-06-13 18:50:19 +000075 %50 = OpConstantComposite %v3uint %uint_268435455 %uint_268435455 %uint_268435455
Ben Claytonc0af5c52022-06-02 14:36:10 +000076 %uint_4 = OpConstant %uint 4
Natalie Chouinarde9027182024-06-13 18:50:19 +000077 %53 = OpConstantComposite %v3uint %uint_4 %uint_4 %uint_4
Ben Claytonc0af5c52022-06-02 14:36:10 +000078%uint_1073741823 = OpConstant %uint 1073741823
Natalie Chouinarde9027182024-06-13 18:50:19 +000079 %59 = OpConstantComposite %v3uint %uint_1073741823 %uint_1073741823 %uint_1073741823
Ben Claytonc0af5c52022-06-02 14:36:10 +000080 %uint_2 = OpConstant %uint 2
Natalie Chouinarde9027182024-06-13 18:50:19 +000081 %62 = OpConstantComposite %v3uint %uint_2 %uint_2 %uint_2
Ben Claytonc0af5c52022-06-02 14:36:10 +000082%uint_2147483647 = OpConstant %uint 2147483647
Natalie Chouinarde9027182024-06-13 18:50:19 +000083 %68 = OpConstantComposite %v3uint %uint_2147483647 %uint_2147483647 %uint_2147483647
Ben Claytonc0af5c52022-06-02 14:36:10 +000084 %uint_1 = OpConstant %uint 1
Natalie Chouinarde9027182024-06-13 18:50:19 +000085 %71 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
86 %81 = OpTypeFunction %v3int
Ben Claytonee36e392022-07-26 14:27:25 +000087 %int_1 = OpConstant %int 1
Natalie Chouinarde9027182024-06-13 18:50:19 +000088 %85 = OpConstantComposite %v3int %int_1 %int_1 %int_1
Ben Claytonc0af5c52022-06-02 14:36:10 +000089%_ptr_Function_v3int = OpTypePointer Function %v3int
Natalie Chouinarde9027182024-06-13 18:50:19 +000090 %void = OpTypeVoid
91 %92 = OpTypeFunction %void
Ben Clayton77a90cb2023-03-06 18:25:08 +000092 %uint_0 = OpConstant %uint 0
93%_ptr_StorageBuffer_v3int = OpTypePointer StorageBuffer %v3int
Natalie Chouinarde9027182024-06-13 18:50:19 +000094%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 Claytonc0af5c52022-06-02 14:36:10 +000099 %float_1 = OpConstant %float 1
Natalie Chouinarde9027182024-06-13 18:50:19 +0000100%tint_count_leading_zeros = OpFunction %v3int None %17
Ben Claytonc0af5c52022-06-02 14:36:10 +0000101 %v = OpFunctionParameter %v3int
Natalie Chouinarde9027182024-06-13 18:50:19 +0000102 %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 Clayton77a90cb2023-03-06 18:25:08 +0000109 %36 = OpLoad %v3uint %x
Natalie Chouinarde9027182024-06-13 18:50:19 +0000110 %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 Clayton77a90cb2023-03-06 18:25:08 +0000115 %45 = OpLoad %v3uint %x
Natalie Chouinarde9027182024-06-13 18:50:19 +0000116 %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 Clayton77a90cb2023-03-06 18:25:08 +0000121 %54 = OpLoad %v3uint %x
Natalie Chouinarde9027182024-06-13 18:50:19 +0000122 %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 Clayton77a90cb2023-03-06 18:25:08 +0000127 %63 = OpLoad %v3uint %x
Natalie Chouinarde9027182024-06-13 18:50:19 +0000128 %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 Claytonc0af5c52022-06-02 14:36:10 +0000143 OpFunctionEnd
Natalie Chouinarde9027182024-06-13 18:50:19 +0000144%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 Claytonc0af5c52022-06-02 14:36:10 +0000160 OpReturn
161 OpFunctionEnd
Natalie Chouinarde9027182024-06-13 18:50:19 +0000162%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 Claytonc0af5c52022-06-02 14:36:10 +0000168 OpFunctionEnd
Natalie Chouinarde9027182024-06-13 18:50:19 +0000169%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 Claytonc0af5c52022-06-02 14:36:10 +0000187 OpStore %vertex_point_size %float_1
188 OpReturn
189 OpFunctionEnd