Size of compressed textures in vulkan

1.1k views Asked by At

how to use compressed textures in Vulkan? Is it the same way as non-compressed textures with formats from one of compressed formats? If yes, when we copy data from memory to GPU, how do we calculate the size of image data? Lets say we have format as VK_FORMAT_ASTC_4x4_UNORM_BLOCK how do we get the size of data to be copied ?

1

There are 1 answers

1
krOoze On

For texel addressing the same way, except you should not cut into the block (i.e. should be in appropriate multiples in the given axis).

For byte addressing it is also quite obvious. The bit sizes are listed next to the formats in 32.3.1. Format Definition chapter.

E.g. image copy command uses texel addressing. For VK_FORMAT_ASTC_4x4_UNORM_BLOCK it would be the same as for any uncompressed format except the width and height offset and size must be a multiple of 4.