WIP: HLSL: add ability to pass struct buffers with counters to fns

This modifies function parameter passing to pass the counter
buffer associated with a struct buffer to a function as a
hidden parameter.  Similarly function declarations will have
hidden parameters added to accept the associated counter buffers.

There is a limitation: if a SB type may or may not have an associated
counter, passing it as a function parameter will assume that it does, and
the counter will appear in the linkage whether or not there is a counter
method used on the object.
This commit is contained in:
steve-lunarg
2017-04-27 11:22:32 -06:00
parent b29cc30cdb
commit 2bb1f39fa7
6 changed files with 533 additions and 108 deletions

View File

@@ -0,0 +1,23 @@
// float4 Fn1(ConsumeStructuredBuffer<float4> arg_c)
// {
// return arg_c.Consume();
// }
float4 Fn2(AppendStructuredBuffer<float4> arg_a, ConsumeStructuredBuffer<float4> arg_c)
{
arg_a.Append(float4(1,2,3,4));
return arg_c.Consume();
}
AppendStructuredBuffer<float4> sbuf_a;
ConsumeStructuredBuffer<float4> sbuf_c;
AppendStructuredBuffer<float4> sbuf_unused;
float4 main(uint pos : FOO) : SV_Target0
{
// Fn1(sbuf_c);
return Fn2(sbuf_a, sbuf_c);
}