diff --git a/rocclr/device/pal/palresource.cpp b/rocclr/device/pal/palresource.cpp index e0ca7241e3..979c0e8879 100644 --- a/rocclr/device/pal/palresource.cpp +++ b/rocclr/device/pal/palresource.cpp @@ -1503,7 +1503,7 @@ bool Resource::partialMemCopyTo(VirtualGPU& gpu, const amd::Coord3D& srcOrigin, gpu.queue(gpu.engineID_).addCmdMemRef(memRef()); gpu.queue(gpu.engineID_).addCmdMemRef(dstResource.memRef()); if (desc().buffer_ && !dstResource.desc().buffer_) { - uint32_t arraySliceIdx = img2Darray ? dstOrigin[2] : 0; + uint32_t arraySliceIdx = img2Darray ? dstOrigin[2] : img1Darray ? dstOrigin[1] : 0; Pal::SubresId ImgSubresId = {0, dstResource.desc().baseLevel_, arraySliceIdx}; Pal::MemoryImageCopyRegion copyRegion = {}; copyRegion.imageSubres = ImgSubresId; @@ -1529,7 +1529,7 @@ bool Resource::partialMemCopyTo(VirtualGPU& gpu, const amd::Coord3D& srcOrigin, gpu.iCmd()->CmdCopyMemoryToImage(*iMem(), *dstResource.image_, imgLayout, 1, ©Region); } else if (!desc().buffer_ && dstResource.desc().buffer_) { Pal::MemoryImageCopyRegion copyRegion = {}; - uint32_t arraySliceIdx = img2Darray ? dstOrigin[2] : 0; + uint32_t arraySliceIdx = img2Darray ? dstOrigin[2] : img1Darray ? dstOrigin[1] : 0; Pal::SubresId ImgSubresId = {0, desc().baseLevel_, arraySliceIdx}; copyRegion.imageSubres = ImgSubresId; copyRegion.imageOffset.x = srcOrigin[0];