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

Fix storage padding and re-enable buffer clean-up #324

Merged
merged 7 commits into from
May 18, 2024
Merged

Fix storage padding and re-enable buffer clean-up #324

merged 7 commits into from
May 18, 2024

Conversation

djeedai
Copy link
Owner

@djeedai djeedai commented May 18, 2024

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

djeedai added 5 commits May 15, 2024 20:21
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
@djeedai djeedai added C - bug Something isn't working A - internal Internal change on a core system labels May 18, 2024
@djeedai djeedai merged commit eb669f5 into main May 18, 2024
13 checks passed
@djeedai djeedai deleted the u/pad256 branch May 18, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - internal Internal change on a core system C - bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RibbonModifier render effects are not applied on Macs
1 participant