]> git.cworth.org Git - apitrace/commitdiff
d3d10,d3d11: Take the UpdateSubresource box in full consideration.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 20 Nov 2012 21:17:56 +0000 (21:17 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 20 Nov 2012 21:17:56 +0000 (21:17 +0000)
helpers/d3d10size.hpp
helpers/d3d11size.hpp

index 92d4544e9b37af4cd4692b3621f5c53900962519..6441bdcb7ae6579e40afcba1eed15f0e47aca7ee 100644 (file)
@@ -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);
 }
 
index f746d80a00b232f530767640ce7de7d3fc90fef4..ed75d64e3ad29f9932ea61309fbca889090c971d 100644 (file)
@@ -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);
 }