diff options
Diffstat (limited to 'helpers/d3d11size.hpp')
-rw-r--r-- | helpers/d3d11size.hpp | 24 |
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) { |