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

Refactor: eliminate unnecessary Option<BufferSize> #7147

Open
kpreid opened this issue Feb 14, 2025 · 0 comments
Open

Refactor: eliminate unnecessary Option<BufferSize> #7147

kpreid opened this issue Feb 14, 2025 · 0 comments
Labels
kind: refactor Making existing function faster or nicer type: enhancement New feature or request

Comments

@kpreid
Copy link
Contributor

kpreid commented Feb 14, 2025

Internally, BufferSlice and various commands take an Option<BufferSize> where None represents “the remainder of the buffer”. I believe, but am not certain, that this is a leftover from before wgpu::Buffers knew and exposed their own size (#2923), and the code may be simplified by making most or all of these internal Options non-optional. The public API would continue to accept Options for convenience; the size would be picked up from the Buffer object whenever it is not specified.

(I discovered this while working on BufferSlice and am making a note of it for later.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: refactor Making existing function faster or nicer type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants