Extract IDs, Registries and Global into wgpu-core-remote (#10053)

This commit is contained in:
Sam authored and GitHub committed 2026-08-14 14:24:01 +02:00
1 parent c38ef53fbe
commit 5cd735daf4
41 files changed
+3123 -3162

No files matched your search

+12 -32
View File
@@ -6,7 +6,6 @@ use macro_rules_attribute::{apply, attribute_alias};
use crate::{
command::ColorAttachments,
id,
instance::Surface,
resource::{Buffer, QuerySet, Texture},
};
@@ -26,10 +25,6 @@ pub trait ReferenceType {
type Tlas: Clone + core::fmt::Debug;
}
/// Reference wgpu objects via numeric IDs assigned by [`crate::identity::IdentityManager`].
#[derive(Clone, Debug)]
pub struct IdReferences;
/// Reference wgpu objects via the integer value of pointers.
///
/// This is used for trace recording and playback. Recording stores the pointer
@@ -44,35 +39,20 @@ pub struct PointerReferences;
#[derive(Clone, Debug)]
pub struct ArcReferences;
impl ReferenceType for IdReferences {
type Buffer = id::BufferId;
type Surface = id::SurfaceId;
type Texture = id::TextureId;
type TextureView = id::TextureViewId;
type ExternalTexture = id::ExternalTextureId;
type QuerySet = id::QuerySetId;
type BindGroup = id::BindGroupId;
type RenderPipeline = id::RenderPipelineId;
type RenderBundle = id::RenderBundleId;
type ComputePipeline = id::ComputePipelineId;
type Blas = id::BlasId;
type Tlas = id::TlasId;
}
#[cfg(any(feature = "trace", feature = "replay"))]
impl ReferenceType for PointerReferences {
type Buffer = id::PointerId<id::markers::Buffer>;
type Surface = id::PointerId<id::markers::Surface>;
type Texture = id::PointerId<id::markers::Texture>;
type TextureView = id::PointerId<id::markers::TextureView>;
type ExternalTexture = id::PointerId<id::markers::ExternalTexture>;
type QuerySet = id::PointerId<id::markers::QuerySet>;
type BindGroup = id::PointerId<id::markers::BindGroup>;
type RenderPipeline = id::PointerId<id::markers::RenderPipeline>;
type RenderBundle = id::PointerId<id::markers::RenderBundle>;
type ComputePipeline = id::PointerId<id::markers::ComputePipeline>;
type Blas = id::PointerId<id::markers::Blas>;
type Tlas = id::PointerId<id::markers::Tlas>;
type Buffer = crate::id::PointerId<crate::id::markers::Buffer>;
type Surface = crate::id::PointerId<crate::id::markers::Surface>;
type Texture = crate::id::PointerId<crate::id::markers::Texture>;
type TextureView = crate::id::PointerId<crate::id::markers::TextureView>;
type ExternalTexture = crate::id::PointerId<crate::id::markers::ExternalTexture>;
type QuerySet = crate::id::PointerId<crate::id::markers::QuerySet>;
type BindGroup = crate::id::PointerId<crate::id::markers::BindGroup>;
type RenderPipeline = crate::id::PointerId<crate::id::markers::RenderPipeline>;
type RenderBundle = crate::id::PointerId<crate::id::markers::RenderBundle>;
type ComputePipeline = crate::id::PointerId<crate::id::markers::ComputePipeline>;
type Blas = crate::id::PointerId<crate::id::markers::Blas>;
type Tlas = crate::id::PointerId<crate::id::markers::Tlas>;
}
impl ReferenceType for ArcReferences {