| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct storage_block |
| 7 |
{ |
| 8 |
uint4 baz; |
| 9 |
int2 quux; |
| 10 |
}; |
| 11 |
|
| 12 |
struct constant_block |
| 13 |
{ |
| 14 |
float4 foo; |
| 15 |
int bar; |
| 16 |
}; |
| 17 |
|
| 18 |
#ifndef SPIRV_CROSS_CONSTANT_ID_0 |
| 19 |
#define SPIRV_CROSS_CONSTANT_ID_0 3 |
| 20 |
#endif |
| 21 |
constant int arraySize = SPIRV_CROSS_CONSTANT_ID_0; |
| 22 |
|
| 23 |
vertex void main0(device storage_block* storage_0 [[buffer(0)]], device storage_block* storage_1 [[buffer(1)]], constant constant_block* constants_0 [[buffer(2)]], constant constant_block* constants_1 [[buffer(3)]], constant constant_block* constants_2 [[buffer(4)]], constant constant_block* constants_3 [[buffer(5)]], array<texture2d<int>, 3> images [[texture(0)]]) |
| 24 |
{ |
| 25 |
device storage_block* storage[] = |
| 26 |
{ |
| 27 |
storage_0, |
| 28 |
storage_1, |
| 29 |
}; |
| 30 |
|
| 31 |
constant constant_block* constants[] = |
| 32 |
{ |
| 33 |
constants_0, |
| 34 |
constants_1, |
| 35 |
constants_2, |
| 36 |
constants_3, |
| 37 |
}; |
| 38 |
|
| 39 |
storage[0]->baz = uint4(constants[3]->foo); |
| 40 |
storage[1]->quux = images[2].read(uint2(int2(constants[1]->bar))).xy; |
| 41 |
} |
| 42 |
|