From a9214f34358b2fc0bf61ef90e3719a13b180b423 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 8 Apr 2020 10:56:00 -0400 Subject: Remove static struct members from layout and reflection (#1310) * * Added MemberFilterStyle - controls action of FilteredMemberList and FilteredMemberRefList * Splt out template implementations * Use more standard method names dofr FilteredMemberRefList * Added reflect-static.slang test * Added isNotEmpty/isEmpty to filtered lists * Added ability to index into filtered list (so not require building of array) * Default MemberFilterStyle to All. * Remove explicit MemberFilterStyle::All --- tests/reflection/reflect-static.slang | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/reflection/reflect-static.slang (limited to 'tests/reflection/reflect-static.slang') diff --git a/tests/reflection/reflect-static.slang b/tests/reflection/reflect-static.slang new file mode 100644 index 000000000..f7a44cde8 --- /dev/null +++ b/tests/reflection/reflect-static.slang @@ -0,0 +1,34 @@ +//TEST:REFLECTION:-profile cs_6_0 -target hlsl -entry computeMain + +struct Thing +{ + static int value; +}; + +struct AnotherThing +{ + int a; + int b; + static Texture2D t; +}; + + +ConstantBuffer cbThing; +ConstantBuffer cbAnotherThing; + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + Texture2D t = AnotherThing::t; + + float4 v = t.Load(int3(dispatchThreadID.x, dispatchThreadID.y, 0)); + + int m = cbAnotherThing.a + cbAnotherThing.b + Thing::value; + + m += int(v.x); + + outputBuffer[dispatchThreadID.x] = m; +} -- cgit v1.2.3