From f66cee08e82f194d3b95ab0ea77a28f9aea3222c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 18 Apr 2019 07:36:42 -0700 Subject: Fixed handling compressed textures in TextureUploaderGL; fixed non-compressed texture offset in Vk backend --- Graphics/GraphicsEngine/interface/GraphicsTypes.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Graphics/GraphicsEngine') 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, -- cgit v1.2.3