Post

Replies

Boosts

Views

Activity

Reply to Metal texture allocated size versus actual image data size
I included examples with only 1 mip and they show similar alignment/padding, so we can rule out mips as a sole reason. In the vulkan example those numbers are the size of the allocation bound to each image. It should not be linear memory since it was created with VK_IMAGE_TILING_OPTIMAL. I really don't want to focus on this though. I only meant it as an example, that on a similar enough platform, it's even possible to have an image/texture whose allocated size is very close to the original data size. I'm interested in any possible setting/flag etc that might help. If it's a bug (i'm doubtful) that would also be great, but if Apple says this is simply "the way it has to be" then that's a valid answer too.
Mar ’22
Reply to Metal texture allocated size versus actual image data size
Thanks for the reply. I know some amount of padding is necessary, but allocating 32kb for a 10kb 256x256 ASTC12x12 texture is somewhat brutal. Even ASTC6x6 has similar behavior: It allocates 96kb for a 40kb 256x256 ASTC6x6 texture. Only ASTC4x4 and 8x8 come close to using "most" of their allocations. I got curious what its like on Android/Vulkan, so i wrote a similar test there and tried it on an Adreno 540 phone (from 2017). The results are much closer to what i was expecting: VK_FORMAT_ASTC_12x12_UNORM_BLOCK D/VK-SAMPLE: 128x128, mips 7, Align: 64, Astc: 2768, Size: 3584 D/VK-SAMPLE: 256x256, mips 8, Align: 64, Astc: 10512, Size: 12032 D/VK-SAMPLE: 512x512, mips 9, Align: 64, Astc: 40096, Size: 42304 D/VK-SAMPLE: 1024x1024, mips 10, Align: 64, Astc: 158432, Size: 163392 D/VK-SAMPLE: 128x128, mips 1, Align: 64, Astc: 1888, Size: 2304 D/VK-SAMPLE: 256x256, mips 1, Align: 64, Astc: 7520, Size: 9216 D/VK-SAMPLE: 512x512, mips 1, Align: 64, Astc: 29360, Size: 30976 D/VK-SAMPLE: 1024x1024, mips 1, Align: 64, Astc: 117424, Size: 123904 VK_FORMAT_ASTC_8x8_UNORM_BLOCK D/VK-SAMPLE: 128x128, mips 7, Align: 64, Astc: 5488, Size: 5888 D/VK-SAMPLE: 256x256, mips 8, Align: 64, Astc: 21872, Size: 22272 D/VK-SAMPLE: 512x512, mips 9, Align: 64, Astc: 87408, Size: 87808 D/VK-SAMPLE: 1024x1024, mips 10, Align: 64, Astc: 349552, Size: 349952 D/VK-SAMPLE: 128x128, mips 1, Align: 64, Astc: 4096, Size: 4096 D/VK-SAMPLE: 256x256, mips 1, Align: 64, Astc: 16384, Size: 16384 D/VK-SAMPLE: 512x512, mips 1, Align: 64, Astc: 65536, Size: 65536 D/VK-SAMPLE: 1024x1024, mips 1, Align: 64, Astc: 262144, Size: 262144 Again, i'm not expecting to get exactly the same numbers or anything, but any reduction would be extremely helpful. I also didn't see much discussion on this issue online, so was hoping someone might have an explanation.
Feb ’22
Reply to Texture Memory Discrepancy
Could you share some more details on the issue, specifically if it can affect the total app memory/memory gauge? I'm having a hard time determining in my case if it's only an issue with the gpu frame capture showing incorrect numbers, or if the memory is being counted as "real" by the os. Next major OS won't be out for quite a while, so any guidance would be greatly appreciated.
Mar ’21