summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-07-20 21:50:42 +0100
committerJose Fonseca <jfonseca@vmware.com>2015-07-21 09:18:45 +0100
commit1e3c0f717bbdc2609fe36f2597a742924186aeb1 (patch)
treeaebd5909d31cca492dd3ee62212cd6dce118539d /helpers
parentbbd178751a1eb75bfbe54bf1a04cd95d8f3d2fa9 (diff)
dxgiretrace: Bring back the D3D11 pitch mismatch warnings.
Diffstat (limited to 'helpers')
-rw-r--r--helpers/d3d11size.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/helpers/d3d11size.hpp b/helpers/d3d11size.hpp
index f3f97b1a..3a5a6f7d 100644
--- a/helpers/d3d11size.hpp
+++ b/helpers/d3d11size.hpp
@@ -203,6 +203,30 @@ _getMapDesc(ID3D11DeviceContext* pContext, ID3D11Resource * pResource, UINT Subr
}
+static inline void
+_normalizeMap(ID3D11Resource * pResource, D3D11_MAPPED_SUBRESOURCE * pMappedResource)
+{
+ D3D11_RESOURCE_DIMENSION Type = D3D11_RESOURCE_DIMENSION_UNKNOWN;
+ pResource->GetType(&Type);
+
+ switch (Type) {
+ default:
+ case D3D11_RESOURCE_DIMENSION_UNKNOWN:
+ assert(0);
+ /* fall-through */
+ case D3D11_RESOURCE_DIMENSION_BUFFER:
+ case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
+ pMappedResource->RowPitch = 0;
+ /* fall-through */
+ case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
+ pMappedResource->DepthPitch = 0;
+ break;
+ case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
+ break;
+ }
+}
+
+
static inline D3D11_QUERY
_getQueryType(ID3D11Query *pQuery)
{