Live data from Hacker News

Hardware Image Compression

ludicon.com

11–18 of 18 posts

Re: Hardware Image Compression

#11
post #7

Unfortunately the article mentions nowhere why a GPU would ever need to compress (rather than decompress) images. What's the application for that? In the beginning the article mentions formats for computer game textures, but I'm pretty sure those already ship compressed, and they only need to be decompressed by the client GPUs.

Someone mentioned environment maps. Anything that's done with framebuffers or render-to-texture might benefit. e.g. Water reflections and refractions, metal surfaces reflecting the world, mirrors in bathrooms, panini distortion for high-FOV cameras, TV screens like the Breencasts in Half-Life 2

Re: Hardware Image Compression

#12
post #7

Unfortunately the article mentions nowhere why a GPU would ever need to compress (rather than decompress) images. What's the application for that? In the beginning the article mentions formats for computer game textures, but I'm pretty sure those already ship compressed, and they only need to be decompressed by the client GPUs.

There are many textures that can't be encoded in advance: images compressed with transmission formats such as jpeg or avif, procedural textures, terrain splatting, user generated textures, environment maps, dynamic lightmaps, etc.

Re: Hardware Image Compression

#13
post #6
post #5

Earlier quoted context omitted.

I don't disagree given your "most" qualifier, but there's a case where every level of hardware would benefit: compression of textures generated at runtime, either via procgen or for e.g. environment maps. This is in a frustrating state at the moment. CPU compression is way too slow. Some people have demoed on-the-fly GPU compression using a compute shader, but annoyingly there is (or at least was at the time) no way…

Agreed. we hit some wired case on Adreno 530, ran into bizarre GPU instruction set issues with the compute shader compressor, that only manifested on Adreno 53x. Ended up having to add a device detection path, and fall back to CPU compression. which defeated much of the point.

Spark supports Adreno 5xx on both GLES and Vulkan backends. Getting the codecs to work on these devices and obtaining good performance was very challenging.

Re: Hardware Image Compression

#14
post #7

Unfortunately the article mentions nowhere why a GPU would ever need to compress (rather than decompress) images. What's the application for that? In the beginning the article mentions formats for computer game textures, but I'm pretty sure those already ship compressed, and they only need to be decompressed by the client GPUs.

Someone mentioned environment maps. Anything that's done with framebuffers or render-to-texture might benefit. e.g. Water reflections and refractions, metal surfaces reflecting the world, mirrors in bathrooms, panini distortion for high-FOV cameras, TV screens like the Breencasts in Half-Life 2

Why would they benefit from hardware compression?

Re: Hardware Image Compression

#15
post #14

Earlier quoted context omitted.

Someone mentioned environment maps. Anything that's done with framebuffers or render-to-texture might benefit. e.g. Water reflections and refractions, metal surfaces reflecting the world, mirrors in bathrooms, panini distortion for high-FOV cameras, TV screens like the Breencasts in Half-Life 2

Why would they benefit from hardware compression?

The most immediate benefit is reduced memory use. Many devices are memory limited and with skyrocketing RAM prices this is becoming more problematic.

Oversubscription drops performance catastrophically, but even without running into memory limits, compression reduces bandwidth which increases performance and lowers power use. This results in better experiences and longer battery life.

Re: Hardware Image Compression

#16
post #14

Earlier quoted context omitted.

Why would they benefit from hardware compression?

The most immediate benefit is reduced memory use. Many devices are memory limited and with skyrocketing RAM prices this is becoming more problematic. Oversubscription drops performance catastrophically, but even without running into memory limits, compression reduces bandwidth which increases performance and lowers power use. This results in better experiences and longer battery life.

But in order to be compressed, don't we have to load the image into memory first, uncompressed? I don't quite see how this could result in reduced memory usage.

Re: Hardware Image Compression

#17
post #16

Earlier quoted context omitted.

The most immediate benefit is reduced memory use. Many devices are memory limited and with skyrocketing RAM prices this is becoming more problematic. Oversubscription drops performance catastrophically, but even without running into memory limits, compression reduces bandwidth which increases performance and lowers power use. This results in better experiences and longer battery life.

But in order to be compressed, don't we have to load the image into memory first, uncompressed? I don't quite see how this could result in reduced memory usage.

It needs to be decompressed, but it does not stay uncompressed. That memory is only used temporarily. Games usually have a pinned staging buffer to upload data to the GPU. This memory is reused and does not contribute significantly to the total memory use.
Post reply on HN