WIP: HLSL: structuredbuffer counter functionality
This is WIP, heavy on the IP part. There's not yet enough to use in real workloads. Currently present: * Creation of separate counter buffers for structured buffer types needing them. * IncrementCounter / DecrementCounter methods * Postprocess to remove unused counter buffers from linkage * Associated counter buffers are given @count suffix (invalid as a user identifier) Not yet present: * reflection queries to obtain bindings for counter buffers * Append/Consume buffers * Ability to use SB references passed as fn parameters
This commit is contained in:
19
Test/hlsl.structbuffer.incdec.frag
Normal file
19
Test/hlsl.structbuffer.incdec.frag
Normal file
@@ -0,0 +1,19 @@
|
||||
RWStructuredBuffer<uint4> sbuf_rw_i;
|
||||
RWStructuredBuffer<uint4> sbuf_rw_d;
|
||||
|
||||
RWStructuredBuffer<uint4> sbuf_rw_nocounter; // doesn't use inc or dec
|
||||
|
||||
float4 main(uint pos : FOO) : SV_Target0
|
||||
{
|
||||
uint4 result = 0;
|
||||
|
||||
sbuf_rw_i[7];
|
||||
sbuf_rw_d[7];
|
||||
|
||||
sbuf_rw_nocounter[5] = 2;
|
||||
|
||||
uint c1 = sbuf_rw_i.IncrementCounter();
|
||||
uint c2 = sbuf_rw_d.DecrementCounter();
|
||||
|
||||
return float4(result.x, result.y, c1, c2);
|
||||
}
|
||||
Reference in New Issue
Block a user