impl DynSurfaceTexture for all surface textures

This commit is contained in:
Andreas Reich committed 2024-08-14 17:34:11 +02:00
1 parent 1d19a205a5
commit 70f7641193
7 files changed
+12 -2

No files matched your search

+1
View File
@@ -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 {}
+1
View File
@@ -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 {}
+1
View File
@@ -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 {}
+1
View File
@@ -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 {
+2 -2
View File
@@ -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;
+3
View File
@@ -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
+3
View File
@@ -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