mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Device now has to implement DynResource
This commit is contained in:
@@ -94,6 +94,7 @@ crate::impl_dyn_resource!(
|
||||
CommandBuffer,
|
||||
CommandEncoder,
|
||||
ComputePipeline,
|
||||
Device,
|
||||
Fence,
|
||||
PipelineCache,
|
||||
PipelineLayout,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use crate::{Device, DynBuffer};
|
||||
use crate::{Device, DynBuffer, DynResource};
|
||||
|
||||
use super::DynResourceExt;
|
||||
|
||||
pub trait DynDevice {
|
||||
pub trait DynDevice: DynResource {
|
||||
unsafe fn destroy_buffer(&self, buffer: Box<dyn DynBuffer>);
|
||||
}
|
||||
|
||||
impl<D: Device> DynDevice for D {
|
||||
impl<D: Device + DynResource> DynDevice for D {
|
||||
unsafe fn destroy_buffer(&self, buffer: Box<dyn DynBuffer>) {
|
||||
unsafe { D::destroy_buffer(self, buffer.unbox()) };
|
||||
}
|
||||
|
||||
@@ -171,6 +171,7 @@ crate::impl_dyn_resource!(
|
||||
CommandBuffer,
|
||||
CommandEncoder,
|
||||
ComputePipeline,
|
||||
Device,
|
||||
Fence,
|
||||
PipelineLayout,
|
||||
QuerySet,
|
||||
|
||||
@@ -394,7 +394,7 @@ pub trait Api: Clone + fmt::Debug + Sized {
|
||||
type Instance: Instance<A = Self>;
|
||||
type Surface: Surface<A = Self>;
|
||||
type Adapter: Adapter<A = Self>;
|
||||
type Device: Device<A = Self>;
|
||||
type Device: DynDevice + Device<A = Self>;
|
||||
|
||||
type Queue: Queue<A = Self>;
|
||||
type CommandEncoder: DynCommandEncoder + CommandEncoder<A = Self>;
|
||||
|
||||
@@ -78,6 +78,7 @@ crate::impl_dyn_resource!(
|
||||
CommandBuffer,
|
||||
CommandEncoder,
|
||||
ComputePipeline,
|
||||
Device,
|
||||
Fence,
|
||||
PipelineLayout,
|
||||
QuerySet,
|
||||
|
||||
@@ -85,6 +85,7 @@ crate::impl_dyn_resource!(
|
||||
CommandBuffer,
|
||||
CommandEncoder,
|
||||
ComputePipeline,
|
||||
Device,
|
||||
Fence,
|
||||
PipelineCache,
|
||||
PipelineLayout,
|
||||
|
||||
Reference in New Issue
Block a user