2a49f7e82d
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.
24 lines
290 B
Plaintext
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);
|
|
}
|
|
|