diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-unit-test/unit-test-parameter-usage-reflection.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/slang-unit-test/unit-test-parameter-usage-reflection.cpp b/tools/slang-unit-test/unit-test-parameter-usage-reflection.cpp index ce9df5a42..e4a89a277 100644 --- a/tools/slang-unit-test/unit-test-parameter-usage-reflection.cpp +++ b/tools/slang-unit-test/unit-test-parameter-usage-reflection.cpp @@ -18,10 +18,15 @@ SLANG_UNIT_TEST(isParameterLocationUsedReflection) // Source for a module that contains an undecorated entrypoint. const char* userSourceBody = R"( Texture2D g_tex : register(t0); + struct Params { + Texture2D tex2; + Texture2D tex3; + }; + ParameterBlock<Params> gParams; [shader("fragment")] - float4 fragMain(float4 pos:SV_Position) : SV_Target + float4 fragMain(float4 pos:SV_Position, float unused:COLOR0, float4 used:COLOR1) : SV_Target { - return g_tex.Load(int3(0, 0, 0)); + return g_tex.Load(int3(0, 0, 0)) + gParams.tex3.Load(int3(0)) + used; } )"; @@ -75,4 +80,16 @@ SLANG_UNIT_TEST(isParameterLocationUsedReflection) metadata->isParameterLocationUsed(SLANG_PARAMETER_CATEGORY_DESCRIPTOR_TABLE_SLOT, 0, 1, isUsed); SLANG_CHECK(!isUsed); + + metadata->isParameterLocationUsed(SLANG_PARAMETER_CATEGORY_DESCRIPTOR_TABLE_SLOT, 1, 0, isUsed); + SLANG_CHECK(!isUsed); + + metadata->isParameterLocationUsed(SLANG_PARAMETER_CATEGORY_DESCRIPTOR_TABLE_SLOT, 1, 1, isUsed); + SLANG_CHECK(isUsed); + + metadata->isParameterLocationUsed(SLANG_PARAMETER_CATEGORY_VARYING_INPUT, 0, 0, isUsed); + SLANG_CHECK(!isUsed); + + metadata->isParameterLocationUsed(SLANG_PARAMETER_CATEGORY_VARYING_INPUT, 0, 1, isUsed); + SLANG_CHECK(isUsed); } |
