SPIRV-Cross/reference/shaders-msl/comp/image.comp
2018-01-29 06:40:45 -08:00

12 lines
438 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
kernel void main0(texture2d<float> uImageIn [[texture(0)]], texture2d<float, access::write> uImageOut [[texture(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
{
float4 v = uImageIn.read(uint2((int2(gl_GlobalInvocationID.xy) + int2(uImageIn.get_width(), uImageIn.get_height()))));
uImageOut.write(v, uint2(int2(gl_GlobalInvocationID.xy)));
}