diff options
| author | Alexey Panteleev <alpanteleev@nvidia.com> | 2022-05-18 10:57:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-18 10:57:37 -0700 |
| commit | 69cb6e8f300d77e74bd2c7dfe15d12e10b38f512 (patch) | |
| tree | c2d23f2883acb28407106a096b55c64111f098b1 /slang.h | |
| parent | 1148564b9cdbbc8fec4fbecf65b0af60aa6af344 (diff) | |
Support for querying which parameters are used in emitted code (#2239)
See https://github.com/shader-slang/slang/issues/2213
Diffstat (limited to 'slang.h')
| -rw-r--r-- | slang.h | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -1355,6 +1355,10 @@ extern "C" SlangCompileRequest* request, SlangCompileFlags flags); + /*! @see slang::ICompileRequest::getCompileFlags */ + SLANG_API SlangCompileFlags spGetCompileFlags( + SlangCompileRequest* request); + /*! @see slang::ICompileRequest::setDumpIntermediates */ SLANG_API void spSetDumpIntermediates( SlangCompileRequest* request, @@ -2147,6 +2151,15 @@ extern "C" SLANG_API unsigned spReflectionParameter_GetBindingIndex(SlangReflectionParameter* parameter); SLANG_API unsigned spReflectionParameter_GetBindingSpace(SlangReflectionParameter* parameter); + SLANG_API SlangResult spIsParameterLocationUsed( + SlangCompileRequest* request, + SlangInt entryPointIndex, + SlangInt targetIndex, + SlangParameterCategory category, // is this a `t` register? `s` register? + SlangUInt spaceIndex, // `space` for D3D12, `set` for Vulkan + SlangUInt registerIndex, // `register` for D3D12, `binding` for Vulkan + bool& outUsed); + // Entry Point Reflection SLANG_API char const* spReflectionEntryPoint_getName( @@ -3371,6 +3384,11 @@ namespace slang SlangCompileFlags flags) = 0; /*! + @brief Returns the compilation flags previously set with `setCompileFlags` + */ + virtual SLANG_NO_THROW SlangCompileFlags SLANG_MCALL getCompileFlags() = 0; + + /*! @brief Set whether to dump intermediate results (for debugging) or not. */ virtual SLANG_NO_THROW void SLANG_MCALL setDumpIntermediates( @@ -3892,6 +3910,14 @@ namespace slang virtual SLANG_NO_THROW SlangResult SLANG_MCALL getProgramWithEntryPoints( slang::IComponentType** outProgram) = 0; + virtual SLANG_NO_THROW SlangResult SLANG_MCALL isParameterLocationUsed( + SlangInt entryPointIndex, + SlangInt targetIndex, + SlangParameterCategory category, + SlangUInt spaceIndex, + SlangUInt registerIndex, + bool& outUsed) = 0; + /** Set the line directive mode for a target. */ virtual SLANG_NO_THROW void SLANG_MCALL setTargetLineDirectiveMode( |
