xref: /third_party/glslang/Test/hlsl.structbuffer.coherent.frag
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/glslang/Test/
1617a3babSopenharmony_cistruct sb_t
2617a3babSopenharmony_ci{
3617a3babSopenharmony_ci    float3 color;
4617a3babSopenharmony_ci    bool   test;
5617a3babSopenharmony_ci};
6617a3babSopenharmony_ci
7617a3babSopenharmony_ci
8617a3babSopenharmony_cigloballycoherent RWStructuredBuffer<sb_t>  sbuf;
9617a3babSopenharmony_cigloballycoherent RWStructuredBuffer<float> sbuf2;
10617a3babSopenharmony_ci
11617a3babSopenharmony_cifloat4 main(uint pos : FOO) : SV_Target0
12617a3babSopenharmony_ci{
13617a3babSopenharmony_ci    sbuf2[pos+1] = 42;
14617a3babSopenharmony_ci
15617a3babSopenharmony_ci    uint size;
16617a3babSopenharmony_ci    uint stride;
17617a3babSopenharmony_ci    sbuf.GetDimensions(size, stride);
18617a3babSopenharmony_ci
19617a3babSopenharmony_ci    if (sbuf[pos].test)
20617a3babSopenharmony_ci        return float4(sbuf[pos].color + sbuf2[pos], 0);
21617a3babSopenharmony_ci    else
22617a3babSopenharmony_ci        return size + stride;
23617a3babSopenharmony_ci}
24

Indexes created Thu Nov 07 10:32:03 CST 2024