@@ -455,15 +455,17 @@ pub(crate) fn validate_texture_copy_range<T>(
455455 // physical size can be larger than the virtual
456456 let extent = extent_virtual. physical_size ( desc. format ) ;
457457
458- // Multisampled and depth-stencil formats do not support partial copies.
458+ // Multisampled and depth-stencil formats do not support partial copies
459+ // on x and y dimensions, but do support copying a subset of layers.
459460 let requires_exact_size = desc. format . is_depth_stencil_format ( ) || desc. sample_count > 1 ;
460461
461462 // Return `Ok` if a run `size` texels long starting at `start_offset` is
462463 // valid for `texture_size`. Otherwise, return an appropriate a`Err`.
463464 let check_dimension = |dimension : TextureErrorDimension ,
464465 start_offset : u32 ,
465466 size : u32 ,
466- texture_size : u32 |
467+ texture_size : u32 ,
468+ requires_exact_size : bool |
467469 -> Result < ( ) , TransferError > {
468470 if requires_exact_size && ( start_offset != 0 || size != texture_size) {
469471 Err ( TransferError :: UnsupportedPartialTransfer {
@@ -495,18 +497,21 @@ pub(crate) fn validate_texture_copy_range<T>(
495497 texture_copy_view. origin . x ,
496498 copy_size. width ,
497499 extent. width ,
500+ requires_exact_size,
498501 ) ?;
499502 check_dimension (
500503 TextureErrorDimension :: Y ,
501504 texture_copy_view. origin . y ,
502505 copy_size. height ,
503506 extent. height ,
507+ requires_exact_size,
504508 ) ?;
505509 check_dimension (
506510 TextureErrorDimension :: Z ,
507511 texture_copy_view. origin . z ,
508512 copy_size. depth_or_array_layers ,
509513 extent. depth_or_array_layers ,
514+ false , // partial copy always allowed on Z/layer dimension
510515 ) ?;
511516
512517 if texture_copy_view. origin . x % block_width != 0 {
0 commit comments