blob: b1d5a2958315d36c08f1ae025277fbb2dd0cb263 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 93
; Schema: 0
OpCapability Shader
%55 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol_1
OpExecutionMode %main OriginUpperLeft
OpName %buf0 "buf0"
OpMemberName %buf0 0 "x_GLF_uniform_float_values"
OpName %x_6 "x_6"
OpName %buf1 "buf1"
OpMemberName %buf1 0 "x_GLF_uniform_int_values"
OpName %x_9 "x_9"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main_1 "main_1"
OpName %f "f"
OpName %i "i"
OpName %a "a"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %main "main"
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %_arr_float_uint_2 ArrayStride 16
OpDecorate %x_6 NonWritable
OpDecorate %x_6 DescriptorSet 0
OpDecorate %x_6 Binding 0
OpDecorate %buf1 Block
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %_arr_int_uint_3 ArrayStride 16
OpDecorate %x_9 NonWritable
OpDecorate %x_9 DescriptorSet 0
OpDecorate %x_9 Binding 1
OpDecorate %tint_symbol_1 Location 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_float_uint_2 = OpTypeArray %float %uint_2
%buf0 = OpTypeStruct %_arr_float_uint_2
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_6 = OpVariable %_ptr_Uniform_buf0 Uniform
%int = OpTypeInt 32 1
%uint_3 = OpConstant %uint 3
%_arr_int_uint_3 = OpTypeArray %int %uint_3
%buf1 = OpTypeStruct %_arr_int_uint_3
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_9 = OpVariable %_ptr_Uniform_buf1 Uniform
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%17 = OpConstantNull %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %17
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %17
%void = OpTypeVoid
%20 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%26 = OpConstantNull %float
%_ptr_Function_int = OpTypePointer Function %int
%29 = OpConstantNull %int
%uint_0 = OpConstant %uint 0
%int_1 = OpConstant %int 1
%_ptr_Uniform_float = OpTypePointer Uniform %float
%_ptr_Uniform_int = OpTypePointer Uniform %int
%int_0 = OpConstant %int 0
%bool = OpTypeBool
%float_1 = OpConstant %float 1
%float_0 = OpConstant %float 0
%int_2 = OpConstant %int 2
%80 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main_out = OpTypeStruct %v4float
%81 = OpTypeFunction %void %main_out
%main_1 = OpFunction %void None %20
%23 = OpLabel
%f = OpVariable %_ptr_Function_float Function %26
%i = OpVariable %_ptr_Function_int Function %29
%a = OpVariable %_ptr_Function_float Function %26
%34 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%35 = OpLoad %float %34
OpStore %f %35
%37 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
%38 = OpLoad %int %37
OpStore %i %38
OpBranch %39
%39 = OpLabel
OpLoopMerge %40 %41 None
OpBranch %42
%42 = OpLabel
%43 = OpLoad %int %i
%45 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
%46 = OpLoad %int %45
%47 = OpSGreaterThan %bool %43 %46
OpSelectionMerge %49 None
OpBranchConditional %47 %50 %51
%50 = OpLabel
OpBranch %49
%51 = OpLabel
OpBranch %40
%49 = OpLabel
%52 = OpLoad %int %i
%56 = OpConvertSToF %float %52
%54 = OpExtInst %float %55 NMax %float_1 %56
%57 = OpFSub %float %float_1 %54
OpStore %a %57
%58 = OpLoad %float %a
%60 = OpExtInst %float %55 NMax %58 %float_0
%59 = OpExtInst %float %55 NMin %60 %float_0
OpStore %f %59
OpBranch %41
%41 = OpLabel
%62 = OpLoad %int %i
%63 = OpISub %int %62 %int_1
OpStore %i %63
OpBranch %39
%40 = OpLabel
%64 = OpLoad %float %f
%65 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%66 = OpLoad %float %65
%67 = OpFOrdEqual %bool %64 %66
OpSelectionMerge %68 None
OpBranchConditional %67 %69 %70
%69 = OpLabel
%72 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_2
%73 = OpLoad %int %72
%74 = OpLoad %float %f
%75 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
%76 = OpLoad %int %75
%77 = OpConvertSToF %float %73
%78 = OpConvertSToF %float %76
%79 = OpCompositeConstruct %v4float %77 %74 %78 %float_1
OpStore %x_GLF_color %79
OpBranch %68
%70 = OpLabel
OpStore %x_GLF_color %80
OpBranch %68
%68 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_2 = OpFunction %void None %81
%tint_symbol = OpFunctionParameter %main_out
%85 = OpLabel
%86 = OpCompositeExtract %v4float %tint_symbol 0
OpStore %tint_symbol_1 %86
OpReturn
OpFunctionEnd
%main = OpFunction %void None %20
%88 = OpLabel
%89 = OpFunctionCall %void %main_1
%91 = OpLoad %v4float %x_GLF_color
%92 = OpCompositeConstruct %main_out %91
%90 = OpFunctionCall %void %tint_symbol_2 %92
OpReturn
OpFunctionEnd