Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
5.10
-
None
Description
There is extreme variability on which compressed formats are supported by which hardware. This needs to be carefully surveyed if we want to create some sort of easy to use "profiles" in a build system (e.g. "target is iMX6" => compress to this format, with these options,etc.)
Desktop
A desktop GPU typically has support for the S3 algorithms (BC1 / BC2 / BC3) via the ubiquitous https://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt extension. They map to the DXT1 / DXT3 / DXT5 formats in Direct3D.
- Notable exception: Mesa drivers on Linux may lack support for the S3 extension, because it's patented (but expires soon http://www.patentcountdown.org/ ).
- Note that DXT2 and DXT4 are not supported by that OpenGL extension, and they're the formats with premultiplied alpha. DXT3 and DXT5 have alpha, but it's assumed to be non-premultiplied.
- Modern desktop GPUs may offer support for the ETC1/ETC2/EAC formats, mostly because they run OpenGL versions high enough and/or which claim some sort of compatibility with OpenGL ES (for instance: OpenGL 4.3 mandates ETC2 support; OpenGL 4.5 you must have full ES 3 compatibility). DO NOT TRUST THE ETC1/2 FORMATS ON DESKTOP (or, in general, "mobile" formats). As I've found out, on my Nvidia ETC2 gets decompressed on the fly (and stored in VRAM decompressed (warning)).
- BC6 supports HDR. Do we even need it?
- BC7 is great but takes a long time to compress. Requires OpenGL 4 grade hardware.
Mobile/Embedded
OpenGL ES-wise, situation is as follows:
- OpenGL ES 2 does not mandate support for any specific texture format, leaving the decision up to the vendor. In other words: you must know in advance.
- OpenGL ES 3 mandates ETC2 support
And that's it. When we look a little closer:
- All Android devices must at least support ETC1 (which does not support alpha). In addition:
- PVRTC is supported on devices with a PowerVR GPU
- ATITC is supported on devices with an Adreno GPU
- S3 is supported on Nvidia decices
- ETC2/EAC is supported on Mali GPUs
- ASTC is supported on newer Mali GPUs
- On iOS:
- All devices support PVRTC according to https://developer.apple.com/library/content/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/TechniquesForWorkingWithTextureData/TechniquesForWorkingWithTextureData.html
- ETC1/ETC2/EAC and ASTC should also be supported on a huge number of devices according to https://developer.apple.com/metal/availability/
- Maybe these formats are not exposed to OpenGL ES, only to Metal!
- On iMX.6:
- The board claims support for OpenGL ES 3, so ETC1, ETC2 and EAC are claimed to be supported (still needs testing to figure out it's not cheating)
—
More research and data collection is needed.
- Esp. for embedded boards, it's not easy to find on the internet what formats are supported. Also on embedded there might be extreme variability.
- Be sure that the format is actually supported by the hardware and not just "reported" but then the textures are uncompressed in VRAM!
- How to handle all the possible compression formats in a build tool?
- How to ship the correct compressed textures for a given device, if there's variability?
Attachments
Issue Links
- resulted in
-
QTBUG-113565 Enhance the warning about the vendor and platform specificness of compressed texture format support in the Image docs
-
- Closed
-