From 8772a4f54c5e245d5bd375e47b6ab9176c95d198 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 20 Nov 2012 21:17:56 +0000 Subject: [PATCH] d3d10,d3d11: Take the UpdateSubresource box in full consideration. --- helpers/d3d10size.hpp | 6 ++++++ helpers/d3d11size.hpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/helpers/d3d10size.hpp b/helpers/d3d10size.hpp index 92d4544..6441bdc 100644 --- a/helpers/d3d10size.hpp +++ b/helpers/d3d10size.hpp @@ -238,6 +238,12 @@ _calcSubresourceSize(ID3D10Resource *pDstResource, UINT DstSubresource, const D3 return 0; } + if (pDstBox) { + Width = pDstBox->right - pDstBox->left; + Height = pDstBox->bottom - pDstBox->top; + Depth = pDstBox->back - pDstBox->front; + } + return _calcMipDataSize(MipLevel, Format, Width, Height, SrcRowPitch, Depth, SrcDepthPitch); } diff --git a/helpers/d3d11size.hpp b/helpers/d3d11size.hpp index f746d80..ed75d64 100644 --- a/helpers/d3d11size.hpp +++ b/helpers/d3d11size.hpp @@ -169,6 +169,12 @@ _calcSubresourceSize(ID3D11Resource *pDstResource, UINT DstSubresource, const D3 return 0; } + if (pDstBox) { + Width = pDstBox->right - pDstBox->left; + Height = pDstBox->bottom - pDstBox->top; + Depth = pDstBox->back - pDstBox->front; + } + return _calcMipDataSize(MipLevel, Format, Width, Height, SrcRowPitch, Depth, SrcDepthPitch); } -- 2.43.0