blob: 0f55dd4c8016deddbd79c7722ae0ad908b499354 [file]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 41
; Schema: 0
OpCapability Shader
%37 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %global "global"
OpName %foo "foo"
OpName %x "x"
OpName %baz "baz"
OpName %x_0 "x"
OpName %bar "bar"
OpName %x_1 "x"
OpName %main "main"
OpName %tint_f32_to_i32 "tint_f32_to_i32"
OpName %value "value"
%int = OpTypeInt 32 1
%_ptr_Private_int = OpTypePointer Private %int
%4 = OpConstantNull %int
%global = OpVariable %_ptr_Private_int Private %4
%void = OpTypeVoid
%float = OpTypeFloat 32
%9 = OpTypeFunction %void %float
%17 = OpTypeFunction %int %int
%int_42 = OpConstant %int 42
%28 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%34 = OpTypeFunction %int %float
%float_n2_14748365e_09 = OpConstant %float -2.14748365e+09
%float_2_14748352e_09 = OpConstant %float 2.14748352e+09
%foo = OpFunction %void None %9
%x = OpFunctionParameter %float
%10 = OpLabel
%11 = OpFunctionCall %int %tint_f32_to_i32 %x
OpSelectionMerge %14 None
OpSwitch %11 %13
%13 = OpLabel
OpBranch %14
%14 = OpLabel
OpReturn
OpFunctionEnd
%baz = OpFunction %int None %17
%x_0 = OpFunctionParameter %int
%18 = OpLabel
OpStore %global %int_42 None
OpReturnValue %x_0
OpFunctionEnd
%bar = OpFunction %void None %9
%x_1 = OpFunctionParameter %float
%22 = OpLabel
%23 = OpFunctionCall %int %tint_f32_to_i32 %x_1
%24 = OpFunctionCall %int %baz %23
OpSelectionMerge %26 None
OpSwitch %24 %25
%25 = OpLabel
OpBranch %26
%26 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %28
%29 = OpLabel
%30 = OpFunctionCall %void %foo %float_1
%32 = OpFunctionCall %void %bar %float_1
OpReturn
OpFunctionEnd
%tint_f32_to_i32 = OpFunction %int None %34
%value = OpFunctionParameter %float
%35 = OpLabel
%36 = OpExtInst %float %37 NClamp %value %float_n2_14748365e_09 %float_2_14748352e_09
%40 = OpConvertFToS %int %36
OpReturnValue %40
OpFunctionEnd