SPIRV-Cross/reference/shaders-msl/comp/image.comp

12 lines
438 B
Plaintext
Raw Normal View History

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
2018-01-26 02:06:55 +00:00
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)));
}