X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=helpers%2Fdxgisize.hpp;h=cbe526fb589716f95341a13584f74de6b8a281c8;hb=a0708b02018902497da4df6c9be05cd053374afc;hp=3048d3fc6cfc3ad29971215676a8df19d77509be;hpb=00622a6e765a3a4fde8d0ba5cca63897647b2adf;p=apitrace diff --git a/helpers/dxgisize.hpp b/helpers/dxgisize.hpp index 3048d3f..cbe526f 100644 --- a/helpers/dxgisize.hpp +++ b/helpers/dxgisize.hpp @@ -41,6 +41,23 @@ #include +#include "os.hpp" + + +/** + * Information about active sub-resource maps + */ +struct _MAP_DESC +{ + VOID * pData; + size_t Size; + + _MAP_DESC(void) : + pData(0), + Size(0) + {} +}; + static size_t _calcDataSize(DXGI_FORMAT Format, UINT Width, UINT Height, UINT RowPitch, UINT Depth = 1, UINT DepthPitch = 0) { @@ -227,10 +244,10 @@ _getNumMipLevels(UINT Width, UINT Height = 1, UINT Depth = 1) { static inline void -_getMapInfo(IDXGISurface *pResource, DXGI_MAPPED_RECT * pLockedRect, UINT MapFlags, - void * & pMappedData, size_t & MappedSize) { - pMappedData = 0; - MappedSize = 0; +_getMapDesc(IDXGISurface *pResource, DXGI_MAPPED_RECT * pLockedRect, UINT MapFlags, + _MAP_DESC & MapDesc) { + MapDesc.pData = 0; + MapDesc.Size = 0; if (!(MapFlags & DXGI_MAP_WRITE)) { return; @@ -242,8 +259,8 @@ _getMapInfo(IDXGISurface *pResource, DXGI_MAPPED_RECT * pLockedRect, UINT MapFla return; } - pMappedData = pLockedRect->pBits; - MappedSize = _calcDataSize(Desc.Format, Desc.Width, Desc.Height, pLockedRect->Pitch); + MapDesc.pData = pLockedRect->pBits; + MapDesc.Size = _calcDataSize(Desc.Format, Desc.Width, Desc.Height, pLockedRect->Pitch); }