I have a buffer that pass the mouse position to the
kernel void compute(texture2d<float, access::write> output [[texture(0)]],
constant float2 &mouse [[buffer(1)]],//<-- mouse buffer
uint2 gid [[thread_position_in_grid]])
{
...
}
How can I make it as global constant so that I can access it in any function outside of kernel? For example:
float abc(float p){
float a = p * globalmouseposition.x;
return a;
}