2018-06-26 21:30:21 +00:00
|
|
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
|
|
|
|
2017-05-19 22:14:08 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
|
|
|
|
struct main0_out
|
|
|
|
{
|
|
|
|
float4 gl_Position [[position]];
|
|
|
|
};
|
|
|
|
|
2018-06-26 21:30:21 +00:00
|
|
|
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
|
|
|
uint2 spvTexelBufferCoord(uint tc)
|
|
|
|
{
|
|
|
|
return uint2(tc % 4096, tc / 4096);
|
|
|
|
}
|
|
|
|
|
2018-04-04 08:00:37 +00:00
|
|
|
vertex main0_out main0(texture2d<float> uSamp [[texture(4)]], texture2d<float> uSampo [[texture(5)]])
|
2017-05-19 22:14:08 +00:00
|
|
|
{
|
|
|
|
main0_out out = {};
|
2018-06-26 21:30:21 +00:00
|
|
|
out.gl_Position = uSamp.read(spvTexelBufferCoord(10)) + uSampo.read(spvTexelBufferCoord(100));
|
2017-05-19 22:14:08 +00:00
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|