blob: bc59e24315d0248d111acfce714e393561b1b48e [file] [log] [blame]
John Stilesdac139a2021-01-26 11:06:42 -05001### Compilation failed:
2
John Stiles4d6310a2021-01-26 19:58:22 -05003error: SPIR-V validation error: Uniform OpVariable <id> '10[%colorWhite]' has illegal type.
4From Vulkan spec, section 14.5.2:
5Variables 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
John Stilesdac139a2021-01-26 11:06:42 -05007
8OpCapability Shader
9%1 = OpExtInstImport "GLSL.std.450"
10OpMemoryModel Logical GLSL450
John Stiles4d6310a2021-01-26 19:58:22 -050011OpEntryPoint Fragment %_entrypoint "_entrypoint" %sk_FragColor %sk_Clockwise
12OpExecutionMode %_entrypoint OriginUpperLeft
13OpName %sk_FragColor "sk_FragColor"
John Stilesdac139a2021-01-26 11:06:42 -050014OpName %sk_Clockwise "sk_Clockwise"
John Stilesb41d5bb2021-01-26 16:28:12 -050015OpName %colorWhite "colorWhite"
John Stiles4d6310a2021-01-26 19:58:22 -050016OpName %_entrypoint "_entrypoint"
John Stilesdac139a2021-01-26 11:06:42 -050017OpName %main "main"
18OpName %x "x"
19OpName %r "r"
20OpName %b "b"
John Stiles4d6310a2021-01-26 19:58:22 -050021OpDecorate %sk_FragColor RelaxedPrecision
22OpDecorate %sk_FragColor Location 0
23OpDecorate %sk_FragColor Index 0
John Stilesdac139a2021-01-26 11:06:42 -050024OpDecorate %sk_Clockwise RelaxedPrecision
25OpDecorate %sk_Clockwise BuiltIn FrontFacing
John Stilesb41d5bb2021-01-26 16:28:12 -050026OpDecorate %colorWhite RelaxedPrecision
27OpDecorate %colorWhite DescriptorSet 0
John Stiles4d6310a2021-01-26 19:58:22 -050028OpDecorate %21 RelaxedPrecision
29OpDecorate %30 RelaxedPrecision
30OpDecorate %34 RelaxedPrecision
31OpDecorate %38 RelaxedPrecision
32OpDecorate %44 RelaxedPrecision
John Stilesdac139a2021-01-26 11:06:42 -050033OpDecorate %46 RelaxedPrecision
John Stiles4d6310a2021-01-26 19:58:22 -050034OpDecorate %53 RelaxedPrecision
35OpDecorate %55 RelaxedPrecision
John Stilesdac139a2021-01-26 11:06:42 -050036OpDecorate %58 RelaxedPrecision
John Stiles4d6310a2021-01-26 19:58:22 -050037OpDecorate %65 RelaxedPrecision
38OpDecorate %66 RelaxedPrecision
39OpDecorate %67 RelaxedPrecision
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 Stilesdac139a2021-01-26 11:06:42 -050044%bool = OpTypeBool
45%_ptr_Input_bool = OpTypePointer Input %bool
46%sk_Clockwise = OpVariable %_ptr_Input_bool Input
John Stilesb41d5bb2021-01-26 16:28:12 -050047%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
48%colorWhite = OpVariable %_ptr_Uniform_v4float Uniform
John Stiles4d6310a2021-01-26 19:58:22 -050049%void = OpTypeVoid
50%14 = OpTypeFunction %void
51%17 = OpTypeFunction %v4float
John Stilesdac139a2021-01-26 11:06:42 -050052%_ptr_Function_v4float = OpTypePointer Function %v4float
John Stilesdac139a2021-01-26 11:06:42 -050053%_ptr_Function_float = OpTypePointer Function %float
54%float_n5 = OpConstant %float -5
55%float_5 = OpConstant %float 5
56%int = OpTypeInt 32 1
57%int_0 = OpConstant %int 0
58%float_0 = OpConstant %float 0
John Stilesb41d5bb2021-01-26 16:28:12 -050059%float_1 = OpConstant %float 1
John Stilesdac139a2021-01-26 11:06:42 -050060%int_2 = OpConstant %int 2
61%int_1 = OpConstant %int 1
John Stiles4d6310a2021-01-26 19:58:22 -050062%_entrypoint = OpFunction %void None %14
63%15 = OpLabel
64%16 = OpFunctionCall %v4float %main
65OpStore %sk_FragColor %16
66OpReturn
67OpFunctionEnd
68%main = OpFunction %v4float None %17
69%18 = OpLabel
John Stilesdac139a2021-01-26 11:06:42 -050070%x = OpVariable %_ptr_Function_v4float Function
71%r = OpVariable %_ptr_Function_float Function
72%b = OpVariable %_ptr_Function_float Function
John Stiles4d6310a2021-01-26 19:58:22 -050073%21 = OpLoad %v4float %colorWhite
74OpStore %x %21
John Stilesdac139a2021-01-26 11:06:42 -050075OpStore %r %float_n5
John Stiles4d6310a2021-01-26 19:58:22 -050076OpBranch %25
77%25 = OpLabel
78OpLoopMerge %29 %28 None
79OpBranch %26
80%26 = OpLabel
81%30 = OpLoad %float %r
82%32 = OpFOrdLessThan %bool %30 %float_5
83OpBranchConditional %32 %27 %29
84%27 = OpLabel
85%34 = OpLoad %float %r
86%33 = OpExtInst %float %1 FAbs %34
87%35 = OpAccessChain %_ptr_Function_float %x %int_0
88OpStore %35 %33
89%38 = OpLoad %v4float %x
90%39 = OpCompositeExtract %float %38 0
91%41 = OpFOrdEqual %bool %39 %float_0
92OpSelectionMerge %43 None
93OpBranchConditional %41 %42 %43
John Stilesdac139a2021-01-26 11:06:42 -050094%42 = OpLabel
John Stiles4d6310a2021-01-26 19:58:22 -050095OpBranch %29
John Stilesdac139a2021-01-26 11:06:42 -050096%43 = OpLabel
John Stiles4d6310a2021-01-26 19:58:22 -050097OpBranch %28
98%28 = OpLabel
99%44 = OpLoad %float %r
100%46 = OpFAdd %float %44 %float_1
101OpStore %r %46
102OpBranch %25
103%29 = OpLabel
104OpStore %b %float_5
105OpBranch %48
106%48 = OpLabel
107OpLoopMerge %52 %51 None
108OpBranch %49
109%49 = OpLabel
110%53 = OpLoad %float %b
111%54 = OpFOrdGreaterThanEqual %bool %53 %float_0
112OpBranchConditional %54 %50 %52
113%50 = OpLabel
114%55 = OpLoad %float %b
115%56 = OpAccessChain %_ptr_Function_float %x %int_2
116OpStore %56 %55
117%58 = OpLoad %v4float %x
118%59 = OpCompositeExtract %float %58 3
119%60 = OpFOrdEqual %bool %59 %float_1
120OpSelectionMerge %62 None
121OpBranchConditional %60 %61 %62
122%61 = OpLabel
123OpBranch %51
124%62 = OpLabel
125%63 = OpAccessChain %_ptr_Function_float %x %int_1
126OpStore %63 %float_0
127OpBranch %51
128%51 = OpLabel
129%65 = OpLoad %float %b
130%66 = OpFSub %float %65 %float_1
131OpStore %b %66
132OpBranch %48
133%52 = OpLabel
134%67 = OpLoad %v4float %x
135OpReturnValue %67
John Stilesdac139a2021-01-26 11:06:42 -0500136OpFunctionEnd
137
1381 error