-
Notifications
You must be signed in to change notification settings - Fork 199
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
Obscure error in 'basic' example with slight modifications. #515
Comments
We could do a better job of handling these errors, but the reasoning behind the error is sound. You have to be able to transfer the atlas texture to an array texture which is all based on sprite and atlas sizes. |
At the time of the error it was unclear what caused it and how to resolve it. Could you elaborate further on the underlying cause? I'd love to contribute better error messaging once I understand the error. |
Sure, when you change the values of those numbers the atlas to array texture code can no longer split the atlas texture up correctly because you are attempting to access texture memory that doesn't exist. When that happens it creates a texture with no z layers(an empty array texture) and wgpu catches that as an error. We can do some validation that the inputs given make some sense and warn the user if its not the case. In previous versions we did not use array textures and the GPU was using the atlas directly. The GPU wraps/clamps the texture and allows any UV coords so it wont error. |
If you take the basic example and make a few modifications you can induce a panic.
on this line here if you set the value to 32.0, 31.0, 17.0 and likely many other numbers, it errors with:
Notably it doesn't error with 8.0 and 9.0.
The text was updated successfully, but these errors were encountered: