diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-04-16 05:54:06 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-04-16 05:54:06 +0000 |
| commit | cc0adba2b0ee08218302b49b6be9edfedb3cd11a (patch) | |
| tree | 04262d557bb6cc5216cc38dd69214d6ab52e0453 /Graphics/GraphicsEngine | |
| parent | Added ITextureUploader::GetStats method (diff) | |
| download | DiligentCore-cc0adba2b0ee08218302b49b6be9edfedb3cd11a.tar.gz DiligentCore-cc0adba2b0ee08218302b49b6be9edfedb3cd11a.zip | |
Added convenience constructors for TextureData and MappedTextureSubresource structs
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/interface/Texture.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngine/interface/Texture.h b/Graphics/GraphicsEngine/interface/Texture.h index 273e8f95..b656c5da 100644 --- a/Graphics/GraphicsEngine/interface/Texture.h +++ b/Graphics/GraphicsEngine/interface/Texture.h @@ -229,7 +229,7 @@ struct TextureSubResData TextureSubResData()noexcept{} /// Initializes the structure members to perform copy from the CPU memory - TextureSubResData(void *_pData, Uint32 _Stride, Uint32 _DepthStride = 0)noexcept : + TextureSubResData(void* _pData, Uint32 _Stride, Uint32 _DepthStride = 0)noexcept : pData (_pData), pSrcBuffer (nullptr), SrcOffset (0), @@ -238,7 +238,7 @@ struct TextureSubResData {} /// Initializes the structure members to perform copy from the GPU buffer - TextureSubResData(IBuffer *_pBuffer, Uint32 _SrcOffset, Uint32 _Stride, Uint32 _DepthStride = 0)noexcept : + TextureSubResData(IBuffer* _pBuffer, Uint32 _SrcOffset, Uint32 _Stride, Uint32 _DepthStride = 0)noexcept : pData (nullptr), pSrcBuffer (_pBuffer), SrcOffset (_SrcOffset), @@ -252,20 +252,38 @@ struct TextureData { /// Pointer to the array of the TextureSubResData elements containing /// information about each subresource. - TextureSubResData* pSubResources = nullptr; + TextureSubResData* pSubResources = nullptr; /// Number of elements in pSubResources array. /// NumSubresources must exactly match the number /// of subresources in the texture. Otherwise an error /// occurs. - Uint32 NumSubresources = 0; + Uint32 NumSubresources = 0; + + TextureData() noexcept {} + + TextureData(TextureSubResData* _pSubResources, + Uint32 _NumSubresources) noexcept : + pSubResources (_pSubResources), + NumSubresources (_NumSubresources) + {} }; struct MappedTextureSubresource { - PVoid pData = nullptr; + PVoid pData = nullptr; Uint32 Stride = 0; Uint32 DepthStride = 0; + + MappedTextureSubresource() noexcept {} + + MappedTextureSubresource(PVoid _pData, + Uint32 _Stride, + Uint32 _DepthStride = 0) noexcept : + pData (_pData), + Stride (_Stride), + DepthStride (_DepthStride) + {} }; /// Texture inteface |
