Skip to content
Discussion options

You must be logged in to vote

The best way to detect the unused parameters is to get the compiled shader's reflection data using Slang's reflection API, and then use some additional functions, namely IComponentType::getEntryPointMetadata(), to get metadata for the entry points in the reflections, and then you can search that metadata for usages of each parameter, checking with IMetadata::isParameterLocationUsed().
See the section "Determining Whether Parameters Are Used" in the chapter "Using the Reflection API" in the user guide for details on how you can do that.

Alternatively, for a simple shader, you could probably get away with compiling the shader with -reflection-json to dump the reflection info to a JSON file,…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@obfuscate
Comment options

@obfuscate
Comment options

@aidanfnv
Comment options

@obfuscate
Comment options

@gtong-nv
Comment options

Answer selected by obfuscate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants