yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Tim FoleyCleanups to `ParameterBlock<T>` behavior. (#304)0f55649cc

master
454 B25 linesraw
1// rewriter-parameter-block.slang
2//TEST_IGNORE_FILE:
3
4// A type that mixes uniform and resource fields
5struct Data
6{
7	int val;
8	RWStructuredBuffer<int> buf;
9};
10
11// A function that uses that type
12int test(Data data, int val)
13{
14	return data.val + data.buf[val];
15}
16
17// A global-scope parameter block of the mixed type
18ParameterBlock<Data> gA;
19
20// A constant buffer declaration containing the mixed type
21cbuffer C
22{
23	int extra;
24	ParameterBlock<Data> gB;
25};