mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
impl DynSurfaceTexture for all surface textures
This commit is contained in:
parent
1d19a205a5
commit
70f7641193
@ -456,6 +456,7 @@ pub struct Texture {
|
||||
}
|
||||
|
||||
impl crate::DynTexture for Texture {}
|
||||
impl crate::DynSurfaceTexture for Texture {}
|
||||
|
||||
unsafe impl Send for Texture {}
|
||||
unsafe impl Sync for Texture {}
|
||||
|
@ -101,6 +101,7 @@ pub trait DynQuerySet: DynResource + std::fmt::Debug {}
|
||||
pub trait DynRenderPipeline: DynResource + std::fmt::Debug {}
|
||||
pub trait DynSampler: DynResource + std::fmt::Debug {}
|
||||
pub trait DynShaderModule: DynResource + std::fmt::Debug {}
|
||||
pub trait DynSurfaceTexture: DynResource + std::fmt::Debug {}
|
||||
pub trait DynTexture: DynResource + std::fmt::Debug {}
|
||||
pub trait DynTextureView: DynResource + std::fmt::Debug {}
|
||||
|
||||
|
@ -51,6 +51,7 @@ impl crate::DynPipelineLayout for Resource {}
|
||||
impl crate::DynQuerySet for Resource {}
|
||||
impl crate::DynRenderPipeline for Resource {}
|
||||
impl crate::DynShaderModule for Resource {}
|
||||
impl crate::DynSurfaceTexture for Resource {}
|
||||
impl crate::DynTexture for Resource {}
|
||||
impl crate::DynTextureView for Resource {}
|
||||
|
||||
|
@ -375,6 +375,7 @@ pub struct Texture {
|
||||
}
|
||||
|
||||
impl crate::DynTexture for Texture {}
|
||||
impl crate::DynSurfaceTexture for Texture {}
|
||||
|
||||
impl Texture {
|
||||
pub fn default_framebuffer(format: wgt::TextureFormat) -> Self {
|
||||
|
@ -269,7 +269,7 @@ pub use dynamic::{
|
||||
DynAccelerationStructure, DynBindGroup, DynBindGroupLayout, DynBuffer, DynCommandBuffer,
|
||||
DynCommandEncoder, DynComputePipeline, DynDevice, DynFence, DynPipelineCache,
|
||||
DynPipelineLayout, DynQuerySet, DynRenderPipeline, DynResource, DynSampler, DynShaderModule,
|
||||
DynTexture, DynTextureView,
|
||||
DynSurfaceTexture, DynTexture, DynTextureView,
|
||||
};
|
||||
|
||||
use std::{
|
||||
@ -411,7 +411,7 @@ pub trait Api: Clone + fmt::Debug + Sized {
|
||||
|
||||
type Buffer: DynBuffer;
|
||||
type Texture: DynTexture;
|
||||
type SurfaceTexture: fmt::Debug + WasmNotSendSync + Borrow<Self::Texture>;
|
||||
type SurfaceTexture: DynSurfaceTexture + fmt::Debug + Borrow<Self::Texture>;
|
||||
type TextureView: DynTextureView;
|
||||
type Sampler: fmt::Debug + WasmNotSendSync;
|
||||
type QuerySet: DynQuerySet;
|
||||
|
@ -86,6 +86,7 @@ crate::impl_dyn_resource!(
|
||||
Sampler,
|
||||
ShaderModule,
|
||||
Surface,
|
||||
SurfaceTexture,
|
||||
Texture,
|
||||
TextureView
|
||||
);
|
||||
@ -381,6 +382,8 @@ pub struct SurfaceTexture {
|
||||
present_with_transaction: bool,
|
||||
}
|
||||
|
||||
impl crate::DynSurfaceTexture for SurfaceTexture {}
|
||||
|
||||
impl std::borrow::Borrow<Texture> for SurfaceTexture {
|
||||
fn borrow(&self) -> &Texture {
|
||||
&self.texture
|
||||
|
@ -94,6 +94,7 @@ crate::impl_dyn_resource!(
|
||||
Sampler,
|
||||
ShaderModule,
|
||||
Surface,
|
||||
SurfaceTexture,
|
||||
Texture,
|
||||
TextureView
|
||||
);
|
||||
@ -377,6 +378,8 @@ pub struct SurfaceTexture {
|
||||
surface_semaphores: Arc<Mutex<SwapchainImageSemaphores>>,
|
||||
}
|
||||
|
||||
impl crate::DynSurfaceTexture for SurfaceTexture {}
|
||||
|
||||
impl Borrow<Texture> for SurfaceTexture {
|
||||
fn borrow(&self) -> &Texture {
|
||||
&self.texture
|
||||
|
Loading…
Reference in New Issue
Block a user