#pragma clang diagnostic ignored "-Wmissing-prototypes" #include #include using namespace metal; template void spvImageFence(ImageT img) { img.fence(); } fragment void main0(texture2d_ms uImageMS [[texture(0)]], texture2d_array uImageArray [[texture(1)]], texture2d uImage [[texture(2)]]) { float4 a = uImageMS.read(uint2(int2(1, 2)), 2); spvImageFence(uImageArray); float4 b = uImageArray.read(uint2(int3(1, 2, 4).xy), uint(int3(1, 2, 4).z)); uImage.write(a, uint2(int2(2, 3))); uImageArray.write(b, uint2(int3(2, 3, 7).xy), uint(int3(2, 3, 7).z)); }