bgfx/3rdparty/glslang/Test/hlsl.structbuffer.frag
Branimir Karadžić 160a1a798e Updated glslang.
2017-02-24 19:28:48 -08:00

24 lines
451 B
GLSL

struct sb_t
{
float3 color;
bool test;
bool test2;
}; // stride = 20
StructuredBuffer<sb_t> sbuf : register(c10);
StructuredBuffer<float> sbuf2;
float4 main(uint pos : FOO) : SV_Target0
{
sb_t mydata = sbuf.Load(pos);
uint size;
uint stride;
sbuf.GetDimensions(size, stride);
if (sbuf[pos].test)
return float4(sbuf[pos].color + sbuf2[pos], 0);
else
return mydata.color.x + size + stride;
}