From 69cb6e8f300d77e74bd2c7dfe15d12e10b38f512 Mon Sep 17 00:00:00 2001 From: Alexey Panteleev Date: Wed, 18 May 2022 10:57:37 -0700 Subject: Support for querying which parameters are used in emitted code (#2239) See https://github.com/shader-slang/slang/issues/2213 --- source/slang/slang-reflection-api.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/slang/slang-reflection-api.cpp') diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index 583e000a6..96b1f9004 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -2580,6 +2580,20 @@ SLANG_API unsigned spReflectionParameter_GetBindingSpace(SlangReflectionParamete spReflectionVariableLayout_GetTypeLayout(varLayout))); } +SLANG_API SlangResult spIsParameterLocationUsed( + SlangCompileRequest* request, + SlangInt entryPointIndex, + SlangInt targetIndex, + SlangParameterCategory category, + SlangUInt spaceIndex, + SlangUInt registerIndex, + bool& outUsed) +{ + if (!request) + return SLANG_E_INVALID_ARG; + + return request->isParameterLocationUsed(entryPointIndex, targetIndex, category, spaceIndex, registerIndex, outUsed); +} // Entry Point Reflection -- cgit v1.2.3