4 ms·
AFAIK lossless compression of textures is not an automatic thing for GPUs, however framebuffers - the things you render to - are losslessly compressed to reduce
by kevingadd 4y ago
AFAIK lossless compression of textures is not an automatic thing for GPUs, however framebuffers - the things you render to - are losslessly compressed to reduce bandwidth usage for rendering and scan-out. You're correct that it's vendor secret sauce. People with access to game console SDKs know a bit more about how it works since you can see the compressed frame buffer contents and you have to manually call the right APIs in the SDK to decompress the frame buffer before you can read it back.
Historically lossless compression has also been applied to the depth buffer when rendering, though it isn't done the same way as the lossless framebuffer compression since depth values are floating point with a limited range. You can find more information about how that stuff works online unlike color compression, since people optimize around it - try searching for "hierarchical Z".
Lossless framebuffer compression becomes especially important in cases where you are using MSAA or SSAA, where you might have a framebuffer containing 4 or more "samples" for every rendered pixel. If all of the samples are from the same polygon, it's quite possible that they will have the same value, so it's really profitable to compress them. Then at the end when you do your "resolve" to turn those 4+ MSAA/SSAA samples into a single pixel, that step becomes easier too.
- rasz 4y ago>"hierarchical Z" isnt that one called compression just for marketing purposes? Afaik its a caching technique aimed at lowering latency cost of touching Zbuffer. It actually takes more ram than just raw non duplicated data.
- kevingadd 4y agoThe full resolution depth data doesn't always exist, which is why it can reduce bandwidth usage. It probably depends on the architecture, I've seen cases where there is no full resolution depth buffer and you have to generate one via decompression.
- astrange 4y ago> AFAIK lossless compression of textures is not an automatic thing for GPUs, however framebuffers - the things you render to - are losslessly compressed to reduce bandwidth usage for rendering and scan-out. Textures can be auto losslessly compressed too, but note it's only useful for textures the CPU/GPU is writing to; you should use ASTC or whatever usual format most of the time. eg it's briefly discussed here https://developer.apple.com/documentation/metal/textures/optimizing_texture_data https://developer.apple.com/documentation/metal/textures/opt...
- kevingadd 4y agoFascinating little feature for Apple to add to their GPUs - I wonder if it's tech they licensed from PowerVR or they invented it. I'm not aware of an equivalent in the Windows space or on game consoles but it would be cool to see one. Typically textures are just swizzled.