-
Notifications
You must be signed in to change notification settings - Fork 363
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
document use of Auto bindings for storage buffers. #1349
Comments
This is already supported, but it's not apparent. Use -fauto-bind-uniforms for both uniform buffer objects and storage buffer objects. Example: #version 450
buffer ABuf { uint a; } B;
void main() {
B.a = 1;
} Compile with The documentation should be improved, though! |
The confusion is that UBO and SSBO in the original SPIR-V 1.0 are both in the "Uniform" storage class, and that naming was used for the command line option, when most people think of them as different. |
Hey, I'm currently using shaderc & spirv_cross from C++, using these options:
However it seems that bindings are not preserved (the auto location binding works perfectly though) and it only takes the bindings that are currently being used, this is a problem because I have 6 different bindings and some are shared between vertex and fragment shader, this leads to binding collision between my shader modules in Vulkan so instead of having a layout with 6 bindings (5 storage buffers and 1 variable size uniform of sampled images), I have a layout with 3 bindings because I merge the bindings from all stages so I can create the layout for the descriptor set used in the pipeline. If I don't merge I get that vertex shader uses 3 bindings (0 to 2) and the same for the fragment shader (same range of binding indices as well). The libraries I'm using for shaderc are shaderc_combinedd.lib and shaderc_combined.lib from the latest Vulkan SDK (1.3.250.1). |
Not sure if it's a problem in my syntax, I've uploaded my shaders and headers, the main shader is basic.vts under shader folder. The rest is headers that basic.vts uses. Note: this is the code that works for me, by hardcoding the binding indices in basic.vts. What I tried is removing the ", binding = BINDING" part from all uniforms and buffers but it didn't work. |
Hi, I realized there is auto binding for uniform buffers but not storage buffers, it would be nice to have that feature.
The text was updated successfully, but these errors were encountered: