SPIRV-Cross/reference/shaders-msl-no-opt/asm/frag/access-chain-array-ubo-partial.asm.frag
Hans-Kristian Arntzen 04af769e85 MSL: Handle partial access chains with array-of-UBO/SSBO.
Need to consider the backing variable, not just plain SPIRVariable.
2022-10-26 11:33:04 +02:00

29 lines
425 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct UBOs
{
float4 v;
};
struct main0_out
{
float4 FragColor [[color(0)]];
};
fragment main0_out main0(constant UBOs* ubos_0 [[buffer(0)]], constant UBOs* ubos_1 [[buffer(1)]])
{
constant UBOs* ubos[] =
{
ubos_0,
ubos_1,
};
main0_out out = {};
out.FragColor = ubos[0]->v + ubos[1]->v;
return out;
}