From: José Fonseca <jose.r.fonseca@gmail.com>
Date: Tue, 20 Nov 2012 21:17:56 +0000 (+0000)
Subject: d3d10,d3d11: Take the UpdateSubresource box in full consideration.
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=8772a4f54c5e245d5bd375e47b6ab9176c95d198;p=apitrace

d3d10,d3d11: Take the UpdateSubresource box in full consideration.
---

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);
 }