From d0f4f8efae1e7220b377ca026b4881d931a72201 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Mon, 7 Feb 2022 16:29:40 -0800 Subject: [PATCH] d3d12: Fix offset for buf/image copies with suballocated buffers Reviewed-by: Sil Vilerino Part-of: --- src/gallium/drivers/d3d12/d3d12_resource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp b/src/gallium/drivers/d3d12/d3d12_resource.cpp index 1ae95167760..791e3638583 100644 --- a/src/gallium/drivers/d3d12/d3d12_resource.cpp +++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp @@ -732,7 +732,7 @@ transfer_buf_to_image_part(struct d3d12_context *ctx, struct copy_info copy_info; copy_info.src = staging_res; copy_info.src_loc = fill_buffer_location(ctx, res, staging_res, trans, depth, resid, z); - copy_info.src_loc.PlacedFootprint.Offset = (z - start_z) * trans->base.b.layer_stride; + copy_info.src_loc.PlacedFootprint.Offset += (z - start_z) * trans->base.b.layer_stride; copy_info.src_box = nullptr; copy_info.dst = res; copy_info.dst_loc = fill_texture_location(res, trans, resid, z); @@ -792,7 +792,7 @@ transfer_image_part_to_buf(struct d3d12_context *ctx, copy_info.dst = staging_res; copy_info.dst_loc = fill_buffer_location(ctx, res, staging_res, trans, depth, resid, z); - copy_info.dst_loc.PlacedFootprint.Offset = (z - start_layer) * trans->base.b.layer_stride; + copy_info.dst_loc.PlacedFootprint.Offset += (z - start_layer) * trans->base.b.layer_stride; copy_info.dst_x = copy_info.dst_y = copy_info.dst_z = 0; bool whole_resource = util_texrange_covers_whole_level(&res->base.b, trans->base.b.level,