2219c4a392
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?
23 lines
344 B
GLSL
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;
|
|
}
|
|
|