https://github.com/shader-slang/slang
Raw File
Tip revision: f44da6cc5c0f211c13bd1eb0743d79c7861ea64e authored by Yong He on 09 February 2024, 02:29:32 UTC
Support pointers in SPIRV. (#3561)
Tip revision: f44da6c
rewriter-parameter-block.slang
// rewriter-parameter-block.slang
//TEST_IGNORE_FILE:

// A type that mixes uniform and resource fields
struct Data
{
	int val;
	RWStructuredBuffer<int> buf;
};

// A function that uses that type
int test(Data data, int val)
{
	return data.val + data.buf[val];
}

// A global-scope parameter block of the mixed type
ParameterBlock<Data> gA;

// A constant buffer declaration containing the mixed type
cbuffer C
{
	int extra;
	ParameterBlock<Data> gB;
};
back to top