mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-14 22:01:04 +00:00
31cd98c7b2
Adjusted a test not to use c register for a structured buffer, they are supposed to use t registers Added comments with hints for what are the register types are used for.
24 lines
451 B
GLSL
24 lines
451 B
GLSL
struct sb_t
|
|
{
|
|
float3 color;
|
|
bool test;
|
|
bool test2;
|
|
}; // stride = 20
|
|
|
|
StructuredBuffer<sb_t> sbuf : register(t10);
|
|
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;
|
|
}
|