-
Notifications
You must be signed in to change notification settings - Fork 921
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
65535 word shader literal limit #5390
Comments
I can't find this validation error in the SPIR-V Environment appendix neither. |
Looks like that's from: The SPIR-V specification also only seems to define a minimum limit of 65,535 UTF-8 encoded characters, so we probably have to truncate at that point unless there's a way to query a higher limit from Vulkan somehow: Each instruction also uses a 16-bit wordcount so I guess there's no real way to bypass a higher upper bound of Out of curiosity, why are you trying to pass a large literal there? Is it a generated type name that uses nested generics or something? |
It is an autogenerated compute shader, so it just happened when I had a big enough input, also I didn't run into it in I don't think it is truncated right now since all my tests pass. This doesn't seem to get hit when I do SPIRV passthrough (using Naga to validate and convert to SPIRV before using SPIRV-Tools crate to validate). |
Comes from Vulkan Validation layers. Turns out there's a knob for it Looks like there's now a memory leak? It just stalls and takes more memory at that point unless I add It stalls on
Don't know if it NVIDIA related since it is the host memory that is leaking. |
Embedding the source shader was added in gfx-rs/naga#2379. I think we need to break the source shader into multiple cc @wicast |
Trying to figure out if this impacts Firefox (not that that's the only important consideration, just for my own sake):
if cfg!(debug_assertions) {
flags |= WriterFlags::DEBUG;
} The |
@eadwu could you try this branch first? i will make a pr later. |
Yep that resolves the issue for me. |
Hi @teoxoy,
I think this is a bug in |
It could be that it's not valid to chunk the source string like this since the resulting byte slices are not guaranteed to be valid utf-8. We should probably split the string at valid boundaries. |
Split by boundry is better I agree.
I don't get it, what is the subject being copied? |
I don't think that's the case. The SPIR-V spec says that the argument of
I was referring to the src of |
good idea, l will do it. |
I tried Ctrl+F'ing https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html for 65535 and cannot find any mention of this limit. Also sounds pretty weird if external shaders can be more than 65535 words but not a string literal (or is this just OOM preventation type thing).
Does not impact
--release
, so is some debug warning. Another possible solution is toggling this warning off since it isn't inherently harmful.The text was updated successfully, but these errors were encountered: