@@ -454,15 +454,17 @@ pub(crate) fn validate_texture_copy_range<T>(
454454 // physical size can be larger than the virtual
455455 let extent = extent_virtual. physical_size ( desc. format ) ;
456456
457- // Multisampled and depth-stencil formats do not support partial copies.
457+ // Multisampled and depth-stencil formats do not support partial copies
458+ // on x and y dimensions, but do support copying a single mip level.
458459 let requires_exact_size = desc. format . is_depth_stencil_format ( ) || desc. sample_count > 1 ;
459460
460461 // Return `Ok` if a run `size` texels long starting at `start_offset` is
461462 // valid for `texture_size`. Otherwise, return an appropriate a`Err`.
462463 let check_dimension = |dimension : TextureErrorDimension ,
463464 start_offset : u32 ,
464465 size : u32 ,
465- texture_size : u32 |
466+ texture_size : u32 ,
467+ requires_exact_size : bool |
466468 -> Result < ( ) , TransferError > {
467469 if requires_exact_size && ( start_offset != 0 || size != texture_size) {
468470 Err ( TransferError :: UnsupportedPartialTransfer {
@@ -494,18 +496,21 @@ pub(crate) fn validate_texture_copy_range<T>(
494496 texture_copy_view. origin . x ,
495497 copy_size. width ,
496498 extent. width ,
499+ requires_exact_size,
497500 ) ?;
498501 check_dimension (
499502 TextureErrorDimension :: Y ,
500503 texture_copy_view. origin . y ,
501504 copy_size. height ,
502505 extent. height ,
506+ requires_exact_size,
503507 ) ?;
504508 check_dimension (
505509 TextureErrorDimension :: Z ,
506510 texture_copy_view. origin . z ,
507511 copy_size. depth_or_array_layers ,
508512 extent. depth_or_array_layers ,
513+ false , // partial copy always allowed on Z/mip dimension
509514 ) ?;
510515
511516 if texture_copy_view. origin . x % block_width != 0 {
0 commit comments