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

Bug in calculating max buffer size #271

Open
zaycev opened this issue Feb 13, 2024 · 4 comments
Open

Bug in calculating max buffer size #271

zaycev opened this issue Feb 13, 2024 · 4 comments
Labels
C - bug Something isn't working need-repro Need a repro to be able to diagnose and fix

Comments

@zaycev
Copy link

zaycev commented Feb 13, 2024

Crate versions
This is critical, please fill. The code is evolving fast, and many bugs get fixed. If you're not on latest please try first on latest release if you can, chances are the bug is fixed there.
bevy version: 0.11.3
bevy_hanabi version: 33936ee944913fd6a4ba8bf55116508bc3f7057c

Describe the bug

wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 731, Vulkan)>`
    In a set_bind_group command
      note: bind group = `<BindGroup-(1531, 1, Vulkan)>`
    Dynamic binding offset index 1 with offset 209920 would overrun the buffer bound to bind group 1 -> binding 3. Buffer size is 209920 bytes, the binding binds bytes 0..624, meaning the maximum the binding can be offset is 209296 bytes
@djeedai
Copy link
Owner

djeedai commented Feb 13, 2024

Thanks @zaycev. Do you have more info on how to reproduce? I'm afraid I can't do much as is. I'm also a bit surprised that neither the encoder not the bind group have a name, normally all Hanabi GPU resources are named to help debugging. The version you're using is also kind of old, if you can upgrade that would be better (Bevy 0.13 is getting out soon).

@zaycev
Copy link
Author

zaycev commented Feb 13, 2024

Thanks @zaycev. Do you have more info on how to reproduce? I'm afraid I can't do much as is. I'm also a bit surprised that neither the encoder not the bind group have a name, normally all Hanabi GPU resources are named to help debugging. The version you're using is also kind of old, if you can upgrade that would be better (Bevy 0.13 is getting out soon).

Thank you for taking a look. I will try to provide more context as I'm debugging this. The error is actually coming from core_2d pipeline, but only when hanabi is included into project.

@zaycev
Copy link
Author

zaycev commented Feb 13, 2024

It seems to be related to the amount of emitter batches. After I fixed the issue with 2D culling, the issue does not repro anymore. I will try to create a similar setup in one the examples and see if I can cause bevy to crash.

@djeedai
Copy link
Owner

djeedai commented Feb 13, 2024

Ok thanks. Wild guess, it sounds like there's a missing bounds check somewhere when some container becomes full.

@djeedai djeedai added C - bug Something isn't working need-repro Need a repro to be able to diagnose and fix labels Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - bug Something isn't working need-repro Need a repro to be able to diagnose and fix
Projects
None yet
Development

No branches or pull requests

2 participants