-
Notifications
You must be signed in to change notification settings - Fork 158
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
Question about Parameter Block Reflection API (Vulkan) #3782
Comments
When I add more parameters as follows:
The GLSL is again what I'd expect (with
For some more context, I'm directly using Slang as a submodule (at the latest commit as of right now), and I'm using this as the target description:
|
You also need to add the result from calling |
I updated the documentation. Removed out of date doc on the API. Please check the user guide for the compilation and reflection API. |
Thank you for the quick response! I found that In both cases, I'm still seeing the EDIT: I see the documentation mentions that the index is actually the byte offset in its parent if the type is a Uniform. Will all "ordinary" resources be bound to the same uniform? |
You are right, it should be SUB_ELEMENT_REGISTER_SPACE. I have updated the documentation here: https://shader-slang.com/slang/user-guide/reflection.html You are right that the "binding" for ordinary uniforms are byte offsets for that uniform in the constant buffer. All global uniforms are placed in a default constant buffer that has the same binding. You can query the binding with |
Hello, I'm trying to use the Reflection API to extract information from Slang shaders, but I'm running into some confusion with the API. According to Issue #669, my understanding is that different parameter blocks should be allocated into different descriptor sets. For example, by slightly extending the hello world example:
Here, I'd expect
buffers
andbuffers2
to occupy sets 0 and 1 respectively (since there are no non-ParameterBlock arguments, so the default set would be empty). This seems to be the case when I manually useslangc
to compile to GLSL:However, when I instead query for the layout reflection using the API using the following loop,
I instead see the following:
I'm referring to the (Slang API User's Guide)[https://shader-slang.com/slang/api-users-guide.html], although it seems to be a bit outdated - did the convention change at some point? I can't seem to find much on reflection in (the newer (?) documentation)[https://shader-slang.com/slang/user-guide/compiling.html#using-the-compilation-api], so any clarification would be much appreciated.
The text was updated successfully, but these errors were encountered: