You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Note : I replaced it with the slang syntax later, which led me to another issue : #5676)
With available reflection functions, the only way I found to know if a given parameter is used is :
slang::IMetadata* metadata;
program->getEntryPointMetadata(0, 0, &metadata, diagnostics.writeRef());
if (diagnostics)
return result.push_error({static_cast<constchar*>(diagnostics->getBufferPointer())});
StageData data;
slang::ProgramLayout* program_lay = program->getLayout();
for (unsigned par_i = 0; par_i < program_lay ->getParameterCount(); par_i++)
{
// will always be set to false if it is a push constantbool b_is_used = true;
slang::VariableLayoutReflection* parameter = program_lay ->getParameterByIndex(par_i);
metadata->isParameterLocationUsed(static_cast<SlangParameterCategory>(parameter->getCategory()), 0, parameter->getBindingIndex(), b_is_used);
...
}
which doesn't works as it always return false.
I'm not sure that isParameterLocationUsed() is expected to works with push constants, but it's the only available method so I guess there is something missing.
The text was updated successfully, but these errors were encountered:
PierreEVEN
changed the title
Reflection : How to know if push constants are used by an entry point (using HLSL syntax)
Reflection API : How to know if push constants are used by an entry point (using HLSL syntax)
Nov 26, 2024
Hi,
I would like to know if a push constant buffer is used by a given entry point.
I was initially using the hlsl syntax to declare my push constants:
With available reflection functions, the only way I found to know if a given parameter is used is :
which doesn't works as it always return false.
I'm not sure that
isParameterLocationUsed()
is expected to works with push constants, but it's the only available method so I guess there is something missing.here is the full shader : playground-link
And how I use the reflection Api :
The text was updated successfully, but these errors were encountered: