John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 1 | ### Compilation failed: |
| 2 | |
| 3 | error: SPIR-V validation error: OpEntryPoint Entry Point <id> '2[%main]'s function return type is not void. |
| 4 | OpEntryPoint Fragment %main "main" %sk_Clockwise |
| 5 | |
| 6 | OpCapability Shader |
| 7 | %1 = OpExtInstImport "GLSL.std.450" |
| 8 | OpMemoryModel Logical GLSL450 |
| 9 | OpEntryPoint Fragment %main "main" %sk_Clockwise |
| 10 | OpExecutionMode %main OriginUpperLeft |
| 11 | OpName %sk_Clockwise "sk_Clockwise" |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 12 | OpName %colorWhite "colorWhite" |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 13 | OpName %main "main" |
| 14 | OpName %x "x" |
| 15 | OpName %r "r" |
| 16 | OpName %b "b" |
| 17 | OpDecorate %sk_Clockwise RelaxedPrecision |
| 18 | OpDecorate %sk_Clockwise BuiltIn FrontFacing |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 19 | OpDecorate %colorWhite RelaxedPrecision |
| 20 | OpDecorate %colorWhite DescriptorSet 0 |
| 21 | OpDecorate %14 RelaxedPrecision |
| 22 | OpDecorate %23 RelaxedPrecision |
| 23 | OpDecorate %27 RelaxedPrecision |
| 24 | OpDecorate %31 RelaxedPrecision |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 25 | OpDecorate %37 RelaxedPrecision |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 26 | OpDecorate %39 RelaxedPrecision |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 27 | OpDecorate %46 RelaxedPrecision |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 28 | OpDecorate %48 RelaxedPrecision |
| 29 | OpDecorate %51 RelaxedPrecision |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 30 | OpDecorate %58 RelaxedPrecision |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 31 | OpDecorate %59 RelaxedPrecision |
| 32 | OpDecorate %60 RelaxedPrecision |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 33 | %bool = OpTypeBool |
| 34 | %_ptr_Input_bool = OpTypePointer Input %bool |
| 35 | %sk_Clockwise = OpVariable %_ptr_Input_bool Input |
| 36 | %float = OpTypeFloat 32 |
| 37 | %v4float = OpTypeVector %float 4 |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 38 | %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float |
| 39 | %colorWhite = OpVariable %_ptr_Uniform_v4float Uniform |
| 40 | %10 = OpTypeFunction %v4float |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 41 | %_ptr_Function_v4float = OpTypePointer Function %v4float |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 42 | %_ptr_Function_float = OpTypePointer Function %float |
| 43 | %float_n5 = OpConstant %float -5 |
| 44 | %float_5 = OpConstant %float 5 |
| 45 | %int = OpTypeInt 32 1 |
| 46 | %int_0 = OpConstant %int 0 |
| 47 | %float_0 = OpConstant %float 0 |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 48 | %float_1 = OpConstant %float 1 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 49 | %int_2 = OpConstant %int 2 |
| 50 | %int_1 = OpConstant %int 1 |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 51 | %main = OpFunction %v4float None %10 |
| 52 | %11 = OpLabel |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 53 | %x = OpVariable %_ptr_Function_v4float Function |
| 54 | %r = OpVariable %_ptr_Function_float Function |
| 55 | %b = OpVariable %_ptr_Function_float Function |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 56 | %14 = OpLoad %v4float %colorWhite |
| 57 | OpStore %x %14 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 58 | OpStore %r %float_n5 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 59 | OpBranch %18 |
| 60 | %18 = OpLabel |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 61 | OpLoopMerge %22 %21 None |
| 62 | OpBranch %19 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 63 | %19 = OpLabel |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 64 | %23 = OpLoad %float %r |
| 65 | %25 = OpFOrdLessThan %bool %23 %float_5 |
| 66 | OpBranchConditional %25 %20 %22 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 67 | %20 = OpLabel |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 68 | %27 = OpLoad %float %r |
| 69 | %26 = OpExtInst %float %1 FAbs %27 |
| 70 | %28 = OpAccessChain %_ptr_Function_float %x %int_0 |
| 71 | OpStore %28 %26 |
| 72 | %31 = OpLoad %v4float %x |
| 73 | %32 = OpCompositeExtract %float %31 0 |
| 74 | %34 = OpFOrdEqual %bool %32 %float_0 |
| 75 | OpSelectionMerge %36 None |
| 76 | OpBranchConditional %34 %35 %36 |
| 77 | %35 = OpLabel |
| 78 | OpBranch %22 |
| 79 | %36 = OpLabel |
| 80 | OpBranch %21 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 81 | %21 = OpLabel |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 82 | %37 = OpLoad %float %r |
| 83 | %39 = OpFAdd %float %37 %float_1 |
| 84 | OpStore %r %39 |
| 85 | OpBranch %18 |
| 86 | %22 = OpLabel |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 87 | OpStore %b %float_5 |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 88 | OpBranch %41 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 89 | %41 = OpLabel |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 90 | OpLoopMerge %45 %44 None |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 91 | OpBranch %42 |
| 92 | %42 = OpLabel |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 93 | %46 = OpLoad %float %b |
| 94 | %47 = OpFOrdGreaterThanEqual %bool %46 %float_0 |
| 95 | OpBranchConditional %47 %43 %45 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 96 | %43 = OpLabel |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame^] | 97 | %48 = OpLoad %float %b |
| 98 | %49 = OpAccessChain %_ptr_Function_float %x %int_2 |
| 99 | OpStore %49 %48 |
| 100 | %51 = OpLoad %v4float %x |
| 101 | %52 = OpCompositeExtract %float %51 3 |
| 102 | %53 = OpFOrdEqual %bool %52 %float_1 |
| 103 | OpSelectionMerge %55 None |
| 104 | OpBranchConditional %53 %54 %55 |
| 105 | %54 = OpLabel |
| 106 | OpBranch %44 |
| 107 | %55 = OpLabel |
| 108 | %56 = OpAccessChain %_ptr_Function_float %x %int_1 |
| 109 | OpStore %56 %float_0 |
| 110 | OpBranch %44 |
| 111 | %44 = OpLabel |
| 112 | %58 = OpLoad %float %b |
| 113 | %59 = OpFSub %float %58 %float_1 |
| 114 | OpStore %b %59 |
| 115 | OpBranch %41 |
| 116 | %45 = OpLabel |
| 117 | %60 = OpLoad %v4float %x |
| 118 | OpReturnValue %60 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 119 | OpFunctionEnd |
| 120 | |
| 121 | 1 error |