SPIRV-Cross/shaders-msl/comp/array-length.comp
Hans-Kristian Arntzen 7b9e0fb428 MSL: Implement OpArrayLength.
This gets rather complicated because MSL does not support OpArrayLength
natively. We need to pass down a buffer which contains buffer sizes, and
we compute the array length on-demand.

Support both discrete descriptors as well as argument buffers.
2019-05-27 16:13:09 +02:00

23 lines
299 B
Plaintext

#version 450
layout(local_size_x = 1) in;
layout(set = 0, binding = 1, std140) buffer SSBO
{
uint size;
float v[];
};
layout(set = 0, binding = 2, std430) buffer SSBO1
{
float bz[];
} ssbos[2];
uint get_size()
{
return v.length() + ssbos[1].bz.length();
}
void main()
{
size = get_size();
}