Expose readonly size/usage on wgpu::Buffer #2904
Labels
area: api
Issues related to API surface
good first issue
Good for newcomers
help required
We need community help to make this happen.
type: enhancement
New feature or request
Is your feature request related to a problem? Please describe.
Per the draft spec, it appears that GPUBuffer is supposed to expose it's size and usage via readonly properties:
https://gpuweb.github.io/gpuweb/#buffer-interface
As of wgpu-rs 0.13.1, on the rust side neither of these properties are currently visible to application code. Also the wgpu::Buffer type doesn't appear to be caching the size at all.
Describe the solution you'd like
Keep a cached copy of the size on wgpu::Buffer, and expose member functions to provide readonly access to both the size and usage fields.
Describe alternatives you've considered
The application can always track these attributes externally, since they are immutable after construction, but I'd hate to permanently incur that added burden on application code.
The text was updated successfully, but these errors were encountered: