From 4713c3b346985f56c515909cd68dcc50597b1c51 Mon Sep 17 00:00:00 2001 From: Jose Fonseca Date: Wed, 12 Aug 2015 11:06:34 +0100 Subject: specs: Support D3D11.3. --- helpers/d3d11size.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'helpers') diff --git a/helpers/d3d11size.hpp b/helpers/d3d11size.hpp index 3a5a6f7d..e3b55eb3 100644 --- a/helpers/d3d11size.hpp +++ b/helpers/d3d11size.hpp @@ -59,11 +59,21 @@ _getNumMipLevels(const D3D11_TEXTURE2D_DESC *pDesc) { return pDesc->MipLevels != 0 ? pDesc->MipLevels : _getNumMipLevels(pDesc->Width, pDesc->Height); } +inline UINT +_getNumMipLevels(const D3D11_TEXTURE2D_DESC1 *pDesc) { + return pDesc->MipLevels != 0 ? pDesc->MipLevels : _getNumMipLevels(pDesc->Width, pDesc->Height); +} + inline UINT _getNumMipLevels(const D3D11_TEXTURE3D_DESC *pDesc) { return pDesc->MipLevels != 0 ? pDesc->MipLevels : _getNumMipLevels(pDesc->Width, pDesc->Height, pDesc->Depth); } +inline UINT +_getNumMipLevels(const D3D11_TEXTURE3D_DESC1 *pDesc) { + return pDesc->MipLevels != 0 ? pDesc->MipLevels : _getNumMipLevels(pDesc->Width, pDesc->Height, pDesc->Depth); +} + inline UINT _getNumSubResources(const D3D11_BUFFER_DESC *pDesc) { return 1; @@ -79,11 +89,21 @@ _getNumSubResources(const D3D11_TEXTURE2D_DESC *pDesc) { return _getNumMipLevels(pDesc) * pDesc->ArraySize; } +inline UINT +_getNumSubResources(const D3D11_TEXTURE2D_DESC1 *pDesc) { + return _getNumMipLevels(pDesc) * pDesc->ArraySize; +} + inline UINT _getNumSubResources(const D3D11_TEXTURE3D_DESC *pDesc) { return _getNumMipLevels(pDesc); } +inline UINT +_getNumSubResources(const D3D11_TEXTURE3D_DESC1 *pDesc) { + return _getNumMipLevels(pDesc); +} + static inline size_t _calcSubresourceSize(const D3D11_BUFFER_DESC *pDesc, UINT Subresource, UINT RowPitch = 0, UINT SlicePitch = 0) { return pDesc->ByteWidth; @@ -101,12 +121,24 @@ _calcSubresourceSize(const D3D11_TEXTURE2D_DESC *pDesc, UINT Subresource, UINT R return _calcMipDataSize(MipLevel, pDesc->Format, pDesc->Width, pDesc->Height, RowPitch, 1, SlicePitch); } +static inline size_t +_calcSubresourceSize(const D3D11_TEXTURE2D_DESC1 *pDesc, UINT Subresource, UINT RowPitch, UINT SlicePitch = 0) { + UINT MipLevel = Subresource % _getNumMipLevels(pDesc); + return _calcMipDataSize(MipLevel, pDesc->Format, pDesc->Width, pDesc->Height, RowPitch, 1, SlicePitch); +} + static inline size_t _calcSubresourceSize(const D3D11_TEXTURE3D_DESC *pDesc, UINT Subresource, UINT RowPitch, UINT SlicePitch) { UINT MipLevel = Subresource; return _calcMipDataSize(MipLevel, pDesc->Format, pDesc->Width, pDesc->Height, RowPitch, pDesc->Depth, SlicePitch); } +static inline size_t +_calcSubresourceSize(const D3D11_TEXTURE3D_DESC1 *pDesc, UINT Subresource, UINT RowPitch, UINT SlicePitch) { + UINT MipLevel = Subresource; + return _calcMipDataSize(MipLevel, pDesc->Format, pDesc->Width, pDesc->Height, RowPitch, pDesc->Depth, SlicePitch); +} + static inline size_t _calcSubresourceSize(ID3D11Resource *pDstResource, UINT DstSubresource, const D3D11_BOX *pDstBox, UINT SrcRowPitch, UINT SrcDepthPitch) { if (pDstBox && -- cgit v1.2.3