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

Throw an error when using [[vk::binding]] on global shader parameters #4251

Open
pedrotrschneider opened this issue May 31, 2024 Discussed in #4232 · 0 comments
Open

Throw an error when using [[vk::binding]] on global shader parameters #4251

pedrotrschneider opened this issue May 31, 2024 Discussed in #4232 · 0 comments
Labels
goal:client support Feature or fix needed for a current slang user. kind:enhancement a desirable new feature, option, or behavior

Comments

@pedrotrschneider
Copy link

pedrotrschneider commented May 31, 2024

Discussed in #4232

Basically, when you write something like this:

[[vk::binding(0, 1)]]
uniform float my_uniform;

The slang compiler ignores the request for the specific descriptor set and binding group and packs all uniforms into one global uniform at descriptor set 0 binding 0. As we discussed in the Discussion Thread, this is intended behavior, but the compiler should warn the user (or, I'd argue, throw a compilation error) that their request was ignored, and maybe include steps on what they need to do to get their desired outcome.

For me, this worked to force slang to abide by my [[vk::binding]] directives, but I don't know if it's the optimal solution:

[[vk::binding(0, 1)]]
ConstantBuffer<float> my_uniform

I would also suggest updating the example in the user's guide, as it does not do what the guide suggests it does.

image

@ArielG-NV ArielG-NV added kind:enhancement a desirable new feature, option, or behavior goal:client support Feature or fix needed for a current slang user. labels Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:client support Feature or fix needed for a current slang user. kind:enhancement a desirable new feature, option, or behavior
Projects
None yet
Development

No branches or pull requests

2 participants