John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 1 | ### Compilation failed: |
| 2 | |
| 3 | error: SPIR-V validation error: Uniform OpVariable <id> '10[%colorWhite]' has illegal type. |
| 4 | From Vulkan spec, section 14.5.2: |
| 5 | Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type |
| 6 | %colorWhite = OpVariable %_ptr_Uniform_v4float Uniform |
| 7 | |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 8 | OpCapability Shader |
| 9 | %1 = OpExtInstImport "GLSL.std.450" |
| 10 | OpMemoryModel Logical GLSL450 |
John Stiles | 4d6310a | 2021-01-26 19:58:22 -0500 | [diff] [blame] | 11 | OpEntryPoint Fragment %_entrypoint "_entrypoint" %sk_FragColor %sk_Clockwise |
| 12 | OpExecutionMode %_entrypoint OriginUpperLeft |
| 13 | OpName %sk_FragColor "sk_FragColor" |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 14 | OpName %sk_Clockwise "sk_Clockwise" |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 15 | OpName %colorWhite "colorWhite" |
John Stiles | 4d6310a | 2021-01-26 19:58:22 -0500 | [diff] [blame] | 16 | OpName %_entrypoint "_entrypoint" |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 17 | OpName %main "main" |
| 18 | OpName %x "x" |
| 19 | OpName %r "r" |
| 20 | OpName %b "b" |
John Stiles | 4d6310a | 2021-01-26 19:58:22 -0500 | [diff] [blame] | 21 | OpDecorate %sk_FragColor RelaxedPrecision |
| 22 | OpDecorate %sk_FragColor Location 0 |
| 23 | OpDecorate %sk_FragColor Index 0 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 24 | OpDecorate %sk_Clockwise RelaxedPrecision |
| 25 | OpDecorate %sk_Clockwise BuiltIn FrontFacing |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 26 | OpDecorate %colorWhite RelaxedPrecision |
| 27 | OpDecorate %colorWhite DescriptorSet 0 |
| 28 | OpDecorate %21 RelaxedPrecision |
| 29 | OpDecorate %30 RelaxedPrecision |
| 30 | OpDecorate %34 RelaxedPrecision |
| 31 | OpDecorate %40 RelaxedPrecision |
| 32 | OpDecorate %45 RelaxedPrecision |
| 33 | OpDecorate %46 RelaxedPrecision |
| 34 | OpDecorate %53 RelaxedPrecision |
| 35 | OpDecorate %55 RelaxedPrecision |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 36 | OpDecorate %58 RelaxedPrecision |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 37 | OpDecorate %65 RelaxedPrecision |
| 38 | OpDecorate %66 RelaxedPrecision |
| 39 | OpDecorate %67 RelaxedPrecision |
John Stiles | 4d6310a | 2021-01-26 19:58:22 -0500 | [diff] [blame] | 40 | %float = OpTypeFloat 32 |
| 41 | %v4float = OpTypeVector %float 4 |
| 42 | %_ptr_Output_v4float = OpTypePointer Output %v4float |
| 43 | %sk_FragColor = OpVariable %_ptr_Output_v4float Output |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 44 | %bool = OpTypeBool |
| 45 | %_ptr_Input_bool = OpTypePointer Input %bool |
| 46 | %sk_Clockwise = OpVariable %_ptr_Input_bool Input |
John Stiles | acba304 | 2021-01-28 15:11:39 -0500 | [diff] [blame] | 47 | %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 48 | %colorWhite = OpVariable %_ptr_Uniform_v4float Uniform |
| 49 | %void = OpTypeVoid |
| 50 | %14 = OpTypeFunction %void |
| 51 | %17 = OpTypeFunction %v4float |
| 52 | %_ptr_Function_v4float = OpTypePointer Function %v4float |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 53 | %_ptr_Function_float = OpTypePointer Function %float |
| 54 | %float_n5 = OpConstant %float -5 |
| 55 | %float_5 = OpConstant %float 5 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 56 | %float_0 = OpConstant %float 0 |
John Stiles | b41d5bb | 2021-01-26 16:28:12 -0500 | [diff] [blame] | 57 | %float_1 = OpConstant %float 1 |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 58 | %int = OpTypeInt 32 1 |
| 59 | %int_0 = OpConstant %int 0 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 60 | %int_2 = OpConstant %int 2 |
| 61 | %int_1 = OpConstant %int 1 |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 62 | %_entrypoint = OpFunction %void None %14 |
| 63 | %15 = OpLabel |
| 64 | %16 = OpFunctionCall %v4float %main |
| 65 | OpStore %sk_FragColor %16 |
John Stiles | 4d6310a | 2021-01-26 19:58:22 -0500 | [diff] [blame] | 66 | OpReturn |
| 67 | OpFunctionEnd |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 68 | %main = OpFunction %v4float None %17 |
| 69 | %18 = OpLabel |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 70 | %x = OpVariable %_ptr_Function_v4float Function |
| 71 | %r = OpVariable %_ptr_Function_float Function |
| 72 | %b = OpVariable %_ptr_Function_float Function |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 73 | %21 = OpLoad %v4float %colorWhite |
| 74 | OpStore %x %21 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 75 | OpStore %r %float_n5 |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 76 | OpBranch %25 |
| 77 | %25 = OpLabel |
| 78 | OpLoopMerge %29 %28 None |
| 79 | OpBranch %26 |
| 80 | %26 = OpLabel |
| 81 | %30 = OpLoad %float %r |
| 82 | %32 = OpFOrdLessThan %bool %30 %float_5 |
| 83 | OpBranchConditional %32 %27 %29 |
| 84 | %27 = OpLabel |
| 85 | %34 = OpLoad %float %r |
| 86 | %33 = OpExtInst %float %1 FClamp %34 %float_0 %float_1 |
| 87 | %37 = OpAccessChain %_ptr_Function_float %x %int_0 |
| 88 | OpStore %37 %33 |
| 89 | %40 = OpLoad %v4float %x |
| 90 | %41 = OpCompositeExtract %float %40 0 |
| 91 | %42 = OpFOrdEqual %bool %41 %float_0 |
| 92 | OpSelectionMerge %44 None |
| 93 | OpBranchConditional %42 %43 %44 |
| 94 | %43 = OpLabel |
| 95 | OpBranch %29 |
| 96 | %44 = OpLabel |
| 97 | OpBranch %28 |
| 98 | %28 = OpLabel |
| 99 | %45 = OpLoad %float %r |
| 100 | %46 = OpFAdd %float %45 %float_1 |
| 101 | OpStore %r %46 |
| 102 | OpBranch %25 |
| 103 | %29 = OpLabel |
John Stiles | 4d6310a | 2021-01-26 19:58:22 -0500 | [diff] [blame] | 104 | OpStore %b %float_5 |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 105 | OpBranch %48 |
| 106 | %48 = OpLabel |
| 107 | OpLoopMerge %52 %51 None |
| 108 | OpBranch %49 |
| 109 | %49 = OpLabel |
| 110 | %53 = OpLoad %float %b |
| 111 | %54 = OpFOrdGreaterThanEqual %bool %53 %float_0 |
| 112 | OpBranchConditional %54 %50 %52 |
| 113 | %50 = OpLabel |
| 114 | %55 = OpLoad %float %b |
| 115 | %56 = OpAccessChain %_ptr_Function_float %x %int_2 |
| 116 | OpStore %56 %55 |
| 117 | %58 = OpLoad %v4float %x |
| 118 | %59 = OpCompositeExtract %float %58 3 |
| 119 | %60 = OpFOrdEqual %bool %59 %float_1 |
| 120 | OpSelectionMerge %62 None |
| 121 | OpBranchConditional %60 %61 %62 |
| 122 | %61 = OpLabel |
| 123 | OpBranch %51 |
| 124 | %62 = OpLabel |
| 125 | %63 = OpAccessChain %_ptr_Function_float %x %int_1 |
| 126 | OpStore %63 %float_0 |
John Stiles | 4d6310a | 2021-01-26 19:58:22 -0500 | [diff] [blame] | 127 | OpBranch %51 |
| 128 | %51 = OpLabel |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 129 | %65 = OpLoad %float %b |
| 130 | %66 = OpFSub %float %65 %float_1 |
| 131 | OpStore %b %66 |
| 132 | OpBranch %48 |
John Stiles | 4d6310a | 2021-01-26 19:58:22 -0500 | [diff] [blame] | 133 | %52 = OpLabel |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 134 | %67 = OpLoad %v4float %x |
| 135 | OpReturnValue %67 |
John Stiles | dac139a | 2021-01-26 11:06:42 -0500 | [diff] [blame] | 136 | OpFunctionEnd |
John Stiles | 0de76f7 | 2021-01-29 09:19:39 -0500 | [diff] [blame^] | 137 | |
| 138 | 1 error |