From 309284e7dca64a63b650cb9008795a4e5426c37a Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Sun, 27 Jun 2021 14:02:16 +0200 Subject: [PATCH] [d3d9] Respect 4 byte pitch when reading back texture --- src/d3d9/d3d9_device.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 2ed44fcfa..d2f46b547 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4167,10 +4167,12 @@ namespace dxvk { cPackedFormat = packedFormat ] (DxvkContext* ctx) { if (cSubresources.aspectMask != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { - ctx->copyImageToBuffer(cImageBuffer, 0, 0, 0, + ctx->copyImageToBuffer(cImageBuffer, 0, 4, 0, cImage, cSubresources, VkOffset3D { 0, 0, 0 }, cLevelExtent); } else { + // Copying DS to a packed buffer is only supported for D24S8 and D32S8 + // right now so the 4 byte row alignment is guaranteed by the format size ctx->copyDepthStencilImageToPackedBuffer( cImageBuffer, 0, VkOffset2D { 0, 0 },