Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push constant not reported as PushConstant by reflection API #5676

Open
ov-l opened this issue Nov 25, 2024 · 1 comment
Open

Push constant not reported as PushConstant by reflection API #5676

ov-l opened this issue Nov 25, 2024 · 1 comment

Comments

@ov-l
Copy link

ov-l commented Nov 25, 2024

Hi,

I am trying to retrieve information from the reflection interface for push constants declared in the program. Reflection interface however reports the parameters as uniform - I am looping over function parameters, and category is always UNIFORM, here is the API I am using:

void SlangModuleCompiler::emitParameter(slang::VariableLayoutReflection* var)
{
  auto variable      = var->getVariable();
  auto typeLayout    = var->getTypeLayout();
  auto categoryCount = var->getCategoryCount();
  if (categoryCount)
  {
    for (uint32_t cc = 0; cc < categoryCount; ++cc)
    {
      auto category = SlangParameterCategory(var->getCategoryByIndex(cc));

Here is the shader for example - Shader

I even tried to use the flat API that I see being used in vk-shader-object-layout.cpp, but I always see binding range count as 0.
Thanks in advance for any help !

@ov-l
Copy link
Author

ov-l commented Nov 25, 2024

For now I am assuming that uniform declaration in a function parameter category has to be assumed to be push constant, as they are emitted as push constant depending upon type layout. Please correct me if this assumption is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants