SPIRV-Cross/reference/shaders-msl-no-opt/comp/bda-restrict-pointer-variable.msl2.comp
Hans-Kristian Arntzen 2a49f7e82d MSL: Fix restrict vs __restrict incompatibility.
restrict was supported, but it broke in MSL 3.0. __restrict works on all
versions, so opt for that instead.

Also check for RestrictPointer decoration and refactor to_restrict() to
not take optional parameter to make it more obvious when implied space
character is added.
2022-10-26 17:52:47 +02:00

24 lines
290 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Ref;
struct Ref
{
float4 v;
};
struct Registers
{
device Ref* foo;
};
kernel void main0(constant Registers& _14 [[buffer(0)]])
{
device Ref* __restrict ref = _14.foo;
ref->v = float4(1.0);
}