mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-26 01:11:22 +01:00
Introduce DynDevice
This commit is contained in:
1 parent
b7e11c76df
commit
add54f19d8
3 files changed
+17
-2
No files matched your search
@@ -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;
|
||||
|
||||
|
||||
+2
-2
@@ -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::{
|
||||
|
||||
Reference in new issue
Block a user