mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Introduce DynDevice
This commit is contained in:
parent
b7e11c76df
commit
add54f19d8
13
wgpu-hal/src/dynamic/device.rs
Normal file
13
wgpu-hal/src/dynamic/device.rs
Normal file
@ -0,0 +1,13 @@
|
||||
use crate::{Device, DynBuffer};
|
||||
|
||||
use super::DynResourceExt;
|
||||
|
||||
pub trait DynDevice {
|
||||
unsafe fn destroy_buffer(&self, buffer: Box<dyn DynBuffer>);
|
||||
}
|
||||
|
||||
impl<D: Device> DynDevice for D {
|
||||
unsafe fn destroy_buffer(&self, buffer: Box<dyn DynBuffer>) {
|
||||
unsafe { D::destroy_buffer(self, buffer.unbox()) };
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
mod command;
|
||||
mod device;
|
||||
|
||||
pub use self::command::DynCommandEncoder;
|
||||
pub use self::device::DynDevice;
|
||||
|
||||
use std::any::Any;
|
||||
|
||||
|
@ -266,8 +266,8 @@ mod dynamic;
|
||||
|
||||
pub(crate) use dynamic::impl_dyn_resource;
|
||||
pub use dynamic::{
|
||||
DynBindGroup, DynBuffer, DynCommandEncoder, DynComputePipeline, DynPipelineLayout, DynQuerySet,
|
||||
DynRenderPipeline, DynResource, DynTexture, DynTextureView,
|
||||
DynBindGroup, DynBuffer, DynCommandEncoder, DynComputePipeline, DynDevice, DynPipelineLayout,
|
||||
DynQuerySet, DynRenderPipeline, DynResource, DynTexture, DynTextureView,
|
||||
};
|
||||
|
||||
use std::{
|
||||
|
Loading…
Reference in New Issue
Block a user