SPIRV-Cross/reference/shaders-msl-no-opt/asm/frag/phi.zero-initialize.asm.frag
Chip Davis 5547b25afe Interleave undef values with constants and types.
Undef values may be of struct type and may be used in constants.
Therefore, they must be interleaved with constants and types.

Fixes the rest of the Vulkan CTS test
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_spec_constant_composite`.

(Please excuse the churn in the reference output; it's an inevitable
result of this change.)
2022-11-20 02:08:37 -08:00

43 lines
591 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
constant int uninit_int = {};
constant int4 uninit_vector = {};
constant float4x4 uninit_matrix = {};
struct Foo
{
int a;
};
constant Foo uninit_foo = {};
struct main0_out
{
float4 FragColor [[color(0)]];
};
struct main0_in
{
float4 vColor [[user(locn0)]];
};
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
int _39 = {};
if (in.vColor.x > 10.0)
{
_39 = 10;
}
else
{
_39 = 20;
}
out.FragColor = in.vColor;
return out;
}