You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve GPU memory management and error handling (Rust-SDL2#87)
This change wraps the inner points for the GPU Shader,
Texture, GraphicsPipeline, Buffer, and TransferBuffer resources
in Arcs so that manual memory management isn't necessary.
These resources require the device to be released, so they
also track a weak pointer back to the device, and their release
is conditional on the device still existing.
The device itself now has its raw pointer wrapped in an Arc.
Clone implementations are added to all of these to make working with
them in a larger project easier.
The release functions were all removed, and the resources can simply be
more idiomatically dropped now.
Additionally, the `wait_and_acquire_swapchain_texture` and
`acquire_swapchain_texture` functions were moved from the Device into
the CommandBuffer. This made more sense organizationally since neither
functions use the device at all, and their first argument is the command
buffer pointer.
Finally, missing error handling was added for many unsafe SDL function calls.
0 commit comments