-
Notifications
You must be signed in to change notification settings - Fork 64
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
RibbonModifier
render effects are not applied on Macs
#322
Comments
#202 also showed some suspicious behavior on macOS. And there's still some similar issue blocking wasm support. Overall my gut feeling is that I suspect Vulkan and DX are more robust to some subtle bug which makes things go horribly wrong on Metal and WASM. But not sure. I'll try to have a look on a mac if I can. |
Can confirm I repeated the same steps on my M1 Mac and had the exact same results as @tompuric |
I have some similar repro, I will try to figure out if I can debug the GPU on macOS. |
Ok I know what's going on, this is a storage buffer alignment issue. Most desktop platforms require a 32-byte alignment, but Metal requires a 256-byte one, and some code ignores that and aligns to 32 bytes always. |
Handle the padding of the `GpuRenderGroupIndirect` structure so that it complies with the GPU device requirements. This previously worked on Windows because Vulkan or GPUs there require a 32-byte alignment which was manually provided (hard-coded in Rust code). However this breaks on Appled Mx GPUs with Metal, where the min alignment is 256 bytes. Fixes #322
Any chance someone can try the |
Fix the padding of all storage buffers to comply with the GPU device requirements, which on most Desktop platforms is 32 bytes, but can be different (for example on macOS M1 and later, it's generally 256 bytes). This fixes a number of issues where effects are not rendering at all, or display strong artifacts. The change is likely over-doing it by padding all structures used in arrays, however this can be optimized as a later pass. Fix a bug in the `CloneModifier` where the shader code was allocating cloned particles without checking the buffer capacity, leading to underflow error and stomping over other parts of the buffer. Re-enable buffer cleaning up on effect deletion, which was commented out during the ribbon change but not fixed, and left disabled. This caused the buffers to fill, leaving no space for new effects even after some effects were deleting, which resulted in newly spawned effects not updating (code was dispatching 0 workground in update pass). Fixes #322
Crate versions
bevy
version: 0.13.2bevy_hanabi
version: 0.11.0-devTesting environments
Describe the bug
I can't confirm if it's just me, but when running examples that utilise the
RibbonModifier
on my Mac, the effect is not applied.All other effects work correctly. No issues on my windows machine.
Expected behavior
I expect to see the same behaviour as shown in the example screenshots and my windows.
To Reproduce
Utilise
main
branch on Mac.Screenshots
Running the examples in windows
Running the examples in mac
The text was updated successfully, but these errors were encountered: