summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-04-18 14:36:42 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-04-18 14:36:42 +0000
commitf66cee08e82f194d3b95ab0ea77a28f9aea3222c (patch)
treed94fe054264df48b5d7aac3bbbb229f56b83dee7 /Graphics/GraphicsEngine
parentFixed copying compressed textures in Vulkan back-end (diff)
downloadDiligentCore-f66cee08e82f194d3b95ab0ea77a28f9aea3222c.tar.gz
DiligentCore-f66cee08e82f194d3b95ab0ea77a28f9aea3222c.zip
Fixed handling compressed textures in TextureUploaderGL; fixed non-compressed texture offset in Vk backend
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index d13a06f5..63cfe7cf 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -1622,6 +1622,13 @@ namespace Diligent
/// For block-compressed formats, compression block height
Uint8 BlockHeight;
+ /// For non-compressed formats, returns the texel size.
+ /// For block-compressed formats, returns the block size.
+ Uint32 GetElementSize() const
+ {
+ return Uint32{ComponentSize} * (ComponentType != COMPONENT_TYPE_COMPRESSED ? Uint32{NumComponents} : Uint32{1});
+ }
+
/// Initializes the structure
TextureFormatAttribs( const Char* _Name,
TEXTURE_FORMAT _Format,