blob: c8f548fe434995a10e046af466438f8f723283c7 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 138
; Schema: 0
OpCapability Shader
%81 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %local_invocation_index_1
OpExecutionMode %main LocalSize 1 1 1
OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %s_block "s_block"
OpMemberName %s_block 0 "inner"
OpName %s "s"
OpName %g1 "g1"
OpName %tint_ftoi "tint_ftoi"
OpName %v "v"
OpName %accept_value "accept_value"
OpName %val "val"
OpName %accept_ptr_deref_call_func "accept_ptr_deref_call_func"
OpName %val_0 "val"
OpName %accept_ptr_deref_pass_through "accept_ptr_deref_pass_through"
OpName %val_1 "val"
OpName %S "S"
OpMemberName %S 0 "a"
OpMemberName %S 1 "b"
OpName %accept_ptr_to_struct_and_access "accept_ptr_to_struct_and_access"
OpName %val_2 "val"
OpName %accept_ptr_to_struct_access_pass_ptr "accept_ptr_to_struct_access_pass_ptr"
OpName %val_3 "val"
OpName %accept_ptr_vec_access_elements "accept_ptr_vec_access_elements"
OpName %v1 "v1"
OpName %call_builtin_with_mod_scope_ptr "call_builtin_with_mod_scope_ptr"
OpName %main_inner "main_inner"
OpName %local_invocation_index "local_invocation_index"
OpName %v1_0 "v1"
OpName %v2 "v2"
OpName %v4 "v4"
OpName %main "main"
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
OpDecorate %s_block Block
OpMemberDecorate %s_block 0 Offset 0
OpDecorate %s DescriptorSet 0
OpDecorate %s Binding 0
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 4
%uint = OpTypeInt 32 0
%_ptr_Input_uint = OpTypePointer Input %uint
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%int = OpTypeInt 32 1
%s_block = OpTypeStruct %int
%_ptr_StorageBuffer_s_block = OpTypePointer StorageBuffer %s_block
%s = OpVariable %_ptr_StorageBuffer_s_block StorageBuffer
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%g1 = OpVariable %_ptr_Workgroup_int Workgroup
%float = OpTypeFloat 32
%10 = OpTypeFunction %int %float
%float_2_14748352e_09 = OpConstant %float 2.14748352e+09
%bool = OpTypeBool
%float_n2_14748365e_09 = OpConstant %float -2.14748365e+09
%int_n2147483648 = OpConstant %int -2147483648
%int_2147483647 = OpConstant %int 2147483647
%25 = OpTypeFunction %int %int
%_ptr_Function_int = OpTypePointer Function %int
%29 = OpTypeFunction %int %_ptr_Function_int
%S = OpTypeStruct %int %int
%_ptr_Function_S = OpTypePointer Function %S
%47 = OpTypeFunction %int %_ptr_Function_S
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%int_2 = OpConstant %int 2
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%71 = OpTypeFunction %int %_ptr_Function_v3float
%_ptr_Function_float = OpTypePointer Function %float
%91 = OpTypeFunction %int
%uint_2 = OpConstant %uint 2
%void = OpTypeVoid
%97 = OpTypeFunction %void %uint
%104 = OpConstantNull %int
%uint_264 = OpConstant %uint 264
%108 = OpConstantNull %S
%110 = OpConstantNull %v3float
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%133 = OpTypeFunction %void
%tint_ftoi = OpFunction %int None %10
%v = OpFunctionParameter %float
%14 = OpLabel
%17 = OpFOrdLessThan %bool %v %float_2_14748352e_09
%21 = OpFOrdLessThan %bool %v %float_n2_14748365e_09
%23 = OpConvertFToS %int %v
%19 = OpSelect %int %21 %int_n2147483648 %23
%15 = OpSelect %int %17 %19 %int_2147483647
OpReturnValue %15
OpFunctionEnd
%accept_value = OpFunction %int None %25
%val = OpFunctionParameter %int
%28 = OpLabel
OpReturnValue %val
OpFunctionEnd
%accept_ptr_deref_call_func = OpFunction %int None %29
%val_0 = OpFunctionParameter %_ptr_Function_int
%33 = OpLabel
%35 = OpLoad %int %val_0
%38 = OpLoad %int %val_0
%36 = OpFunctionCall %int %accept_value %38
%39 = OpIAdd %int %35 %36
OpReturnValue %39
OpFunctionEnd
%accept_ptr_deref_pass_through = OpFunction %int None %29
%val_1 = OpFunctionParameter %_ptr_Function_int
%42 = OpLabel
%44 = OpLoad %int %val_1
%45 = OpFunctionCall %int %accept_ptr_deref_call_func %val_1
%46 = OpIAdd %int %44 %45
OpReturnValue %46
OpFunctionEnd
%accept_ptr_to_struct_and_access = OpFunction %int None %47
%val_2 = OpFunctionParameter %_ptr_Function_S
%52 = OpLabel
%55 = OpAccessChain %_ptr_Function_int %val_2 %uint_0
%56 = OpLoad %int %55
%59 = OpAccessChain %_ptr_Function_int %val_2 %uint_1
%60 = OpLoad %int %59
%61 = OpIAdd %int %56 %60
OpReturnValue %61
OpFunctionEnd
%accept_ptr_to_struct_access_pass_ptr = OpFunction %int None %47
%val_3 = OpFunctionParameter %_ptr_Function_S
%64 = OpLabel
%66 = OpAccessChain %_ptr_Function_int %val_3 %uint_0
OpStore %66 %int_2
%69 = OpAccessChain %_ptr_Function_int %val_3 %uint_0
%70 = OpLoad %int %69
OpReturnValue %70
OpFunctionEnd
%accept_ptr_vec_access_elements = OpFunction %int None %71
%v1 = OpFunctionParameter %_ptr_Function_v3float
%76 = OpLabel
%79 = OpAccessChain %_ptr_Function_float %v1 %uint_0
%83 = OpLoad %v3float %v1
%85 = OpLoad %v3float %v1
%80 = OpExtInst %v3float %81 Cross %83 %85
%86 = OpCompositeExtract %float %80 0
OpStore %79 %86
%89 = OpAccessChain %_ptr_Function_float %v1 %uint_0
%90 = OpLoad %float %89
%87 = OpFunctionCall %int %tint_ftoi %90
OpReturnValue %87
OpFunctionEnd
%call_builtin_with_mod_scope_ptr = OpFunction %int None %91
%93 = OpLabel
%94 = OpAtomicLoad %int %g1 %uint_2 %uint_0
OpReturnValue %94
OpFunctionEnd
%main_inner = OpFunction %void None %97
%local_invocation_index = OpFunctionParameter %uint
%101 = OpLabel
%v1_0 = OpVariable %_ptr_Function_int Function %104
%v2 = OpVariable %_ptr_Function_S Function %108
%v4 = OpVariable %_ptr_Function_v3float Function %110
OpAtomicStore %g1 %uint_2 %uint_0 %104
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %v1_0 %104
OpStore %v2 %108
OpStore %v4 %110
%112 = OpAtomicLoad %int %g1 %uint_2 %uint_0
%114 = OpFunctionCall %int %accept_ptr_deref_pass_through %v1_0
%116 = OpFunctionCall %int %accept_ptr_to_struct_and_access %v2
%118 = OpFunctionCall %int %accept_ptr_to_struct_and_access %v2
%120 = OpFunctionCall %int %accept_ptr_vec_access_elements %v4
%122 = OpFunctionCall %int %accept_ptr_to_struct_access_pass_ptr %v2
%124 = OpFunctionCall %int %call_builtin_with_mod_scope_ptr
%126 = OpAccessChain %_ptr_StorageBuffer_int %s %uint_0
%127 = OpIAdd %int %114 %116
%128 = OpIAdd %int %127 %118
%129 = OpIAdd %int %128 %120
%130 = OpIAdd %int %129 %122
%131 = OpIAdd %int %130 %124
%132 = OpIAdd %int %131 %112
OpStore %126 %132
OpReturn
OpFunctionEnd
%main = OpFunction %void None %133
%135 = OpLabel
%137 = OpLoad %uint %local_invocation_index_1
%136 = OpFunctionCall %void %main_inner %137
OpReturn
OpFunctionEnd