SPIRV-Cross/reference/opt/shaders-msl/frag/buffer-read-write.texture-buffer-native.msl21.frag
Hans-Kristian Arntzen fc4f39b11f MSL: Support native texture_buffer type, throw error on atomics.
Atomics are not supported on images or texture_buffers in MSL.
Properly throw an error if OpImageTexelPointer is used (since it can
only be used for atomic operations anyways).
2019-04-23 12:21:43 +02:00

19 lines
423 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 FragColor [[color(0)]];
};
fragment main0_out main0(texture_buffer<float> buf [[texture(0)]], texture_buffer<float, access::write> bufOut [[texture(1)]], float4 gl_FragCoord [[position]])
{
main0_out out = {};
out.FragColor = buf.read(0);
bufOut.write(out.FragColor, int(gl_FragCoord.x));
return out;
}