Skip to content

Commit

Permalink
feat(types): add deprecated type aliases for idents. in 2024-08 s…
Browse files Browse the repository at this point in the history
…pec. rename
  • Loading branch information
ErichDonGubler committed Nov 27, 2024
1 parent c05aa10 commit 9436d56
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
18 changes: 18 additions & 0 deletions wgpu-core/src/command/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ pub type TexelCopyBufferInfo = wgt::TexelCopyBufferInfo<BufferId>;
pub type TexelCopyTextureInfo = wgt::TexelCopyTextureInfo<TextureId>;
pub type CopyExternalImageDestInfo = wgt::CopyExternalImageDestInfo<TextureId>;

#[deprecated(
since = "24.0.0",
note = "This has been renamed to `TexelCopyBufferInfo`, and will be removed in 25.0.0."
)]
pub type ImageCopyBuffer = wgt::TexelCopyBufferInfo<BufferId>;

#[deprecated(
since = "24.0.0",
note = "This has been renamed to `TexelCopyTextureInfo`, and will be removed in 25.0.0."
)]
pub type ImageCopyTexture = wgt::TexelCopyTextureInfo<TextureId>;

#[deprecated(
since = "24.0.0",
note = "This has been renamed to `TexelCopyTextureSourceInfo`, and will be removed in 25.0.0."
)]
pub type ImageCopyTextureTagged = wgt::CopyExternalImageDestInfo<TextureId>;

#[derive(Clone, Copy, Debug)]
pub enum CopySide {
Source,
Expand Down
36 changes: 36 additions & 0 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6404,6 +6404,13 @@ pub struct TexelCopyBufferLayout {
pub rows_per_image: Option<u32>,
}

/// Old name for a [`TexelCopyBufferLayout`].
#[deprecated(
since = "24.0.0",
note = "This has been renamed to `TexelCopyBufferLayout`, and will be removed in 25.0.0."
)]
pub type ImageDataLayout = TexelCopyBufferLayout;

/// Specific type of a buffer binding.
///
/// Corresponds to [WebGPU `GPUBufferBindingType`](
Expand Down Expand Up @@ -6821,6 +6828,13 @@ pub struct TexelCopyBufferInfo<B> {
pub layout: TexelCopyBufferLayout,
}

/// Old name for a [`TexelCopyBufferInfo`].
#[deprecated(
since = "24.0.0",
note = "This has been renamed to `TexelCopyBufferInfo`, and will be removed in 25.0.0."
)]
pub type ImageCopyBuffer<B> = TexelCopyBufferInfo<B>;

/// View of a texture which can be used to copy to/from a buffer/texture.
///
/// Corresponds to [WebGPU `GPUTexelCopyTextureInfo`](
Expand Down Expand Up @@ -6862,6 +6876,13 @@ impl<T> TexelCopyTextureInfo<T> {
}
}

/// Old name for a [`TexelCopyTextureInfo`].
#[deprecated(
since = "24.0.0",
note = "This has been renamed to `TexelCopyTextureInfo`, and will be removed in 25.0.0."
)]
pub type ImageCopyTexture<T> = TexelCopyTextureInfo<T>;

/// View of an external texture that can be used to copy to a texture.
///
/// Corresponds to [WebGPU `GPUCopyExternalImageSourceInfo`](
Expand All @@ -6885,6 +6906,14 @@ pub struct CopyExternalImageSourceInfo {
pub flip_y: bool,
}

/// Old name for a [`CopyExternalImageSourceInfo`].
#[deprecated(
since = "24.0.0",
note = "This has been renamed to `CopyExternalImageSourceInfo`, and will be removed in 25.0.0."
)]
#[cfg(target_arch = "wasm32")]
pub type ImageCopyExternalImage = CopyExternalImageSourceInfo;

/// Source of an external texture copy.
///
/// Corresponds to the [implicit union type on WebGPU `GPUCopyExternalImageSourceInfo.source`](
Expand Down Expand Up @@ -7021,6 +7050,13 @@ impl<T> CopyExternalImageDestInfo<T> {
}
}

/// Old name for a [`CopyExternalImageDestInfo`].
#[deprecated(
since = "24.0.0",
note = "This has been renamed to `CopyExternalImageDestInfo`, and will be removed in 25.0.0."
)]
pub type ImageCopyTextureTagged<T> = CopyExternalImageDestInfo<T>;

/// Subresource range within an image
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
Expand Down
5 changes: 5 additions & 0 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ pub use wgt::{
COPY_BYTES_PER_ROW_ALIGNMENT, MAP_ALIGNMENT, PUSH_CONSTANT_ALIGNMENT,
QUERY_RESOLVE_BUFFER_ALIGNMENT, QUERY_SET_MAX_QUERIES, QUERY_SIZE, VERTEX_STRIDE_ALIGNMENT,
};
#[allow(deprecated)]
pub use wgt::{ImageCopyBuffer, ImageCopyTexture, ImageCopyTextureTagged, ImageDataLayout};
// wasm-only types, we try to keep as many types non-platform
// specific, but these need to depend on web-sys.
#[cfg(any(webgpu, webgl))]
#[allow(deprecated)]
pub use wgt::ImageCopyExternalImage;
#[cfg(any(webgpu, webgl))]
pub use wgt::{CopyExternalImageSourceInfo, ExternalImageSource};

//
Expand Down

0 comments on commit 9436d56

Please sign in to comment.