Skip to content

Commit

Permalink
move queue methods on the Queue type
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy committed Oct 10, 2024
1 parent e02ae3e commit 2b52cf9
Show file tree
Hide file tree
Showing 4 changed files with 280 additions and 212 deletions.
12 changes: 6 additions & 6 deletions wgpu-core/src/command/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub enum TransferError {
#[error(transparent)]
MissingTextureUsage(#[from] MissingTextureUsageError),
#[error("Destination texture is missing the `RENDER_ATTACHMENT` usage flag")]
MissingRenderAttachmentUsageFlag(TextureId),
MissingRenderAttachmentUsageFlag,
#[error("Copy of {start_offset}..{end_offset} would end up overrunning the bounds of the {side:?} buffer of size {buffer_size}")]
BufferOverrun {
start_offset: BufferAddress,
Expand All @@ -72,7 +72,7 @@ pub enum TransferError {
#[error("Unable to select texture mip level {level} out of {total}")]
InvalidTextureMipLevel { level: u32, total: u32 },
#[error("Texture dimension must be 2D when copying from an external texture")]
InvalidDimensionExternal(TextureId),
InvalidDimensionExternal,
#[error("Buffer offset {0} is not aligned to block size or `COPY_BUFFER_ALIGNMENT`")]
UnalignedBufferOffset(BufferAddress),
#[error("Copy size {0} does not respect `COPY_BUFFER_ALIGNMENT`")]
Expand Down Expand Up @@ -156,8 +156,8 @@ impl From<DeviceError> for CopyError {
}
}

pub(crate) fn extract_texture_selector(
copy_texture: &ImageCopyTexture,
pub(crate) fn extract_texture_selector<T>(
copy_texture: &wgt::ImageCopyTexture<T>,
copy_size: &Extent3d,
texture: &Texture,
) -> Result<(TextureSelector, hal::TextureCopyBase), TransferError> {
Expand Down Expand Up @@ -314,8 +314,8 @@ pub(crate) fn validate_linear_texture_data(
/// Returns the HAL copy extent and the layer count.
///
/// [vtcr]: https://gpuweb.github.io/gpuweb/#validating-texture-copy-range
pub(crate) fn validate_texture_copy_range(
texture_copy_view: &ImageCopyTexture,
pub(crate) fn validate_texture_copy_range<T>(
texture_copy_view: &wgt::ImageCopyTexture<T>,
desc: &wgt::TextureDescriptor<(), Vec<wgt::TextureFormat>>,
texture_side: CopySide,
copy_size: &Extent3d,
Expand Down
Loading

0 comments on commit 2b52cf9

Please sign in to comment.