From 207e4017bb8fa2cf612ebbadcbff53aef3f41994 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 8 Aug 2019 11:05:45 +0100 Subject: [PATCH] Calculate correct row pitch for proxy YUV textures --- renderdoc/driver/d3d11/d3d11_replay.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 7b2165117..8d981d5e5 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -3407,8 +3407,7 @@ void D3D11Replay::SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint3 return; } - ctx->UpdateSubresource(tex->GetReal(), sub, NULL, data, - GetByteSize(desc.Width, 1, 1, desc.Format, mip), + ctx->UpdateSubresource(tex->GetReal(), sub, NULL, data, GetRowPitch(desc.Width, desc.Format, mip), GetByteSize(desc.Width, 1, 1, desc.Format, mip)); } else if(WrappedID3D11Texture2D1::m_TextureList.find(texid) != @@ -3452,7 +3451,7 @@ void D3D11Replay::SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint3 m_pDevice->GetReal()->CreateTexture2D(&uploadDesc, NULL, &uploadTex); ctx->UpdateSubresource(uploadTex, arrayIdx, NULL, data, - GetByteSize(desc.Width, 1, 1, desc.Format, mip), + GetRowPitch(desc.Width, desc.Format, mip), GetByteSize(desc.Width, desc.Height, 1, desc.Format, mip)); // copy that slice into MSAA sample @@ -3465,7 +3464,7 @@ void D3D11Replay::SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint3 uint32_t sub = arrayIdx * mips + mip; ctx->UpdateSubresource(tex->GetReal(), sub, NULL, data, - GetByteSize(desc.Width, 1, 1, desc.Format, mip), + GetRowPitch(desc.Width, desc.Format, mip), GetByteSize(desc.Width, desc.Height, 1, desc.Format, mip)); } } @@ -3493,8 +3492,7 @@ void D3D11Replay::SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint3 return; } - ctx->UpdateSubresource(tex->GetReal(), mip, NULL, data, - GetByteSize(desc.Width, 1, 1, desc.Format, mip), + ctx->UpdateSubresource(tex->GetReal(), mip, NULL, data, GetRowPitch(desc.Width, desc.Format, mip), GetByteSize(desc.Width, desc.Height, 1, desc.Format, mip)); } else