xref: /aosp_15_r20/external/skia/tests/sksl/spirv/StructArrayMemberInDifferentLayouts.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1### Compilation failed:
2
3error: SPIR-V validation error: Expected Constituent type to be equal to the corresponding member type of Result Type struct
4  %27 = OpCompositeConstruct %S %26
5
6               OpCapability Shader
7          %1 = OpExtInstImport "GLSL.std.450"
8               OpMemoryModel Logical GLSL450
9               OpEntryPoint Fragment %main "main" %sk_FragColor
10               OpExecutionMode %main OriginUpperLeft
11               OpName %testPushConstants "testPushConstants"
12               OpMemberName %testPushConstants 0 "pushConstantArray"
13               OpName %testUniforms "testUniforms"
14               OpMemberName %testUniforms 0 "uboArray"
15               OpName %sk_FragColor "sk_FragColor"
16               OpName %main "main"
17               OpName %S "S"
18               OpMemberName %S 0 "a"
19               OpName %s1 "s1"
20               OpName %s2 "s2"
21               OpDecorate %_arr_float_int_2 ArrayStride 4
22               OpMemberDecorate %testPushConstants 0 Offset 0
23               OpDecorate %testPushConstants Block
24               OpDecorate %_arr_float_int_2_0 ArrayStride 16
25               OpMemberDecorate %testUniforms 0 Offset 0
26               OpDecorate %testUniforms Block
27               OpDecorate %10 Binding 0
28               OpDecorate %10 DescriptorSet 0
29               OpDecorate %sk_FragColor RelaxedPrecision
30               OpDecorate %sk_FragColor Location 0
31               OpDecorate %sk_FragColor Index 0
32               OpMemberDecorate %S 0 Offset 0
33               OpDecorate %50 RelaxedPrecision
34      %float = OpTypeFloat 32
35        %int = OpTypeInt 32 1
36      %int_2 = OpConstant %int 2
37%_arr_float_int_2 = OpTypeArray %float %int_2
38%testPushConstants = OpTypeStruct %_arr_float_int_2
39%_ptr_PushConstant_testPushConstants = OpTypePointer PushConstant %testPushConstants
40          %3 = OpVariable %_ptr_PushConstant_testPushConstants PushConstant
41%_arr_float_int_2_0 = OpTypeArray %float %int_2
42%testUniforms = OpTypeStruct %_arr_float_int_2_0
43%_ptr_Uniform_testUniforms = OpTypePointer Uniform %testUniforms
44         %10 = OpVariable %_ptr_Uniform_testUniforms Uniform
45    %v4float = OpTypeVector %float 4
46%_ptr_Output_v4float = OpTypePointer Output %v4float
47%sk_FragColor = OpVariable %_ptr_Output_v4float Output
48       %void = OpTypeVoid
49         %18 = OpTypeFunction %void
50          %S = OpTypeStruct %_arr_float_int_2_0
51%_ptr_Function_S = OpTypePointer Function %S
52      %int_0 = OpConstant %int 0
53%_ptr_PushConstant__arr_float_int_2 = OpTypePointer PushConstant %_arr_float_int_2
54%_ptr_Uniform__arr_float_int_2_0 = OpTypePointer Uniform %_arr_float_int_2_0
55       %bool = OpTypeBool
56%_ptr_Function_v4float = OpTypePointer Function %v4float
57    %float_1 = OpConstant %float 1
58         %47 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
59    %float_0 = OpConstant %float 0
60         %49 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
61       %main = OpFunction %void None %18
62         %19 = OpLabel
63         %s1 = OpVariable %_ptr_Function_S Function
64         %s2 = OpVariable %_ptr_Function_S Function
65         %41 = OpVariable %_ptr_Function_v4float Function
66         %24 = OpAccessChain %_ptr_PushConstant__arr_float_int_2 %3 %int_0
67         %26 = OpLoad %_arr_float_int_2 %24
68         %27 = OpCompositeConstruct %S %26
69               OpStore %s1 %27
70         %29 = OpAccessChain %_ptr_Uniform__arr_float_int_2_0 %10 %int_0
71         %31 = OpLoad %_arr_float_int_2_0 %29
72         %32 = OpCompositeConstruct %S %31
73               OpStore %s2 %32
74         %33 = OpCompositeExtract %float %26 0
75         %34 = OpCompositeExtract %float %31 0
76         %35 = OpFOrdEqual %bool %33 %34
77         %37 = OpCompositeExtract %float %26 1
78         %38 = OpCompositeExtract %float %31 1
79         %39 = OpFOrdEqual %bool %37 %38
80         %40 = OpLogicalAnd %bool %39 %35
81               OpSelectionMerge %45 None
82               OpBranchConditional %40 %43 %44
83         %43 = OpLabel
84               OpStore %41 %47
85               OpBranch %45
86         %44 = OpLabel
87               OpStore %41 %49
88               OpBranch %45
89         %45 = OpLabel
90         %50 = OpLoad %v4float %41
91               OpStore %sk_FragColor %50
92               OpReturn
93               OpFunctionEnd
94
951 error
96