SPIRV-Cross/reference/shaders-msl/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.msl23.frag
Chip Davis 2219c4a392 MSL: Support SPV_EXT_demote_to_helper_invocation for MSL 2.3.
MSL 2.3 has everything needed to support this extension on all
platforms. The existing `discard_fragment()` function was given demote
semantics, similar to Direct3D, and the `simd_is_helper_thread()`
function was finally added to iOS.

I've left the old test alone. Should I remove it in favor of these?
2020-10-13 00:25:32 -05:00

23 lines
344 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 FragColor [[color(0)]];
};
fragment main0_out main0()
{
main0_out out = {};
bool _15 = simd_is_helper_thread();
discard_fragment();
if (!_15)
{
out.FragColor = float4(1.0, 0.0, 0.0, 1.0);
}
return out;
}