18f23c47d9
In Metal render pipelines don't have an option to set a sampleMask parameter, the only way to get that functionality is to set the sample_mask output of the fragment shader to this value directly. We also need to take care to combine the fixed sample mask with the one that the shader might possibly output.
21 lines
381 B
GLSL
21 lines
381 B
GLSL
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct main0_out
|
|
{
|
|
float4 FragColor [[color(0)]];
|
|
uint gl_SampleMask [[sample_mask]];
|
|
};
|
|
|
|
fragment main0_out main0(uint gl_SampleMaskIn [[sample_mask]])
|
|
{
|
|
main0_out out = {};
|
|
out.FragColor = float4(1.0);
|
|
out.gl_SampleMask = gl_SampleMaskIn;
|
|
out.gl_SampleMask &= 34;
|
|
return out;
|
|
}
|
|
|