-
Notifications
You must be signed in to change notification settings - Fork 438
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
vulkano-shaders generate different types with the same name in one namespace #1530
Comments
Clearly these need to have different names, but what should they be? |
Maybe macro will create namespaces with memory layout as name? e.g. |
What about the names |
I accidentally stumbled upon this old issue. I'll elaborate a bit more for future reference. Given this definition in GLSL: struct Foo {
float bar;
};
layout(push_constant) uniform PushConstants {
Foo x;
} pc;
layout(binding = 0) uniform Uniforms {
Foo x;
} uni; The shader compiler will generate this SPIR-V output:
Two different structures with the name
Now, the two Vulkano-shaders can't deal with this situation at the moment. When presented with two different structs named |
This was fixed in #2132. |
After some Discord discussion we concluded that the issue is only fixed in the case of duplicate structs. It's not fixed if the structs actually have different definitions, like in my last example above. |
For context, the way I see it is that as long as we have a stuct registration mechanism in place which tracks structs across different shaders, this is very difficult (maybe impossible?) to solve completely. We could append a number at the end of the struct name inside a shader, but what if two different shaders have the same type of collision, but their numberings end up being different? |
For the following code:
vulkano-shaders
generates 2 types with nameFoo
. I think this is because shader uses the same structure with different memory layoutsstd140
andshared
(uses by default).The text was updated successfully, but these errors were encountered: