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

Optimize BufferTable<T> #385

Merged
merged 2 commits into from
Oct 19, 2024
Merged

Optimize BufferTable<T> #385

merged 2 commits into from
Oct 19, 2024

Conversation

djeedai
Copy link
Owner

@djeedai djeedai commented Oct 19, 2024

Clean-up and optimize BufferTable<T>:

  • Change row counts to u32 type; this helps a bit readability.
  • Fix doc link.
  • Use mapped_at_creation to upload the newly added data when a new Buffer is created, instead of doing some buffer copies. This ensures all new rows are copied in a single call, and makes better use of the WGPU staging buffer.

This change should not alter any behavior. It was originally a tentative workaround for some bug with Metal debugging, but proved useless for that purpose. However the minor optimization and code clean-up are nonetheless relevant.

Clean-up and optimize `BufferTable<T>`:
- Change row counts to `u32` type; this helps a bit readability.
- Fix doc link.
- Use `mapped_at_creation` to upload the newly added data when a new `Buffer`
  is created, instead of doing some buffer copies. This ensures all new rows
are copied in a single call, and makes better use of the WGPU staging buffer.

This change should not alter any behavior. It was originally a tentative
workaround for some bug with Metal debugging, but proved useless for that
purpose. However the minor optimization and code clean-up are nonetheless
relevant.
@djeedai djeedai added C - enhancement New feature or request A - internal Internal change on a core system labels Oct 19, 2024
@djeedai djeedai merged commit 7a54ddf into main Oct 19, 2024
13 of 14 checks passed
@djeedai djeedai deleted the u/buffer-table branch October 19, 2024 11:20
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 - enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant