anholt / mesa

this repo is dead. See https://gitlab.freedesktop.org/mesa/mesa master branch for latest usable vc4 and v3d, and https://gitlab.freedesktop.org/anholt/mesa for old vc4/v3d WIP branches
120 stars 40 forks source link

vc4: automatic S3TC->ETC1 conversion when loading textures? #108

Open volkertb opened 6 years ago

volkertb commented 6 years ago

This might be a crazy idea, but couldn't the VC4 Mesa driver be enhanced with "virtual" S3TC support (gl_ext_texture_compression_s3tc), with any uploaded S3TC-compressed textures automatically being transcoded to ETC1 on the fly (in software) before being stored in the video memory?

I understand that transcoding textures would lead to some visual quality loss, as well as a somewhat longer initial texture loading time, but the VC4's video memory is limited, so texture compression would be useful. Also this way, the VC4's hardware support for ETC1-compressed textures would be put to good use.

This could benefit some games and projects like OpenMW that require S3TC compression to work properly with original game assets. Yes, such games and projects could be patched (and/or the assets converted) by the user, but having the driver take care of this automatically would be much more flexible and convenient.

Thank you for considering this.

anholt commented 6 years ago

It's not the first time the idea has come up, but we don't have an online compressor for ETC1 in Mesa that I know of (since online compression is expensive and apps generally do compression at build time instead), so someone would have to find someone else's. I'm not planning on working on it, myself.