godot
godot copied to clipboard
[Experimental] Add Betsy GPU texture compressor
A proof-of-concept implementation of the Betsy GPU texture compressor. Currently, the only supported formats are BC1 and BC6.
In terms of performance it is comparable to etcpak, albeit the results are significantly higher-quality, especially with BC1.
TODO:
- [ ] Add all other formats currently supported by Betsy,
- [ ] Look into BC7 and ASTC,
- [ ] Improve the parallelization of the process. Currently each mip map is compressed one after another, ideally they should all be compressed concurrently and combined at the end,
- [ ] Clean up the code,
- [ ] Get some insight from someone with more knowledge about compute shaders whether I'm doing this correctly,
- [ ] Find a way to speed up RGB to RGBA texture conversion (RGB formats cannot be sampled directly),
- [ ] Use the default static methods in
Imageinstead of rd-specific variants, - [ ] Some of the shader code was modified, ideally it should be reverted to how it is in upstream,
- [ ] Test on a lot of different GPUs,
- [ ] Move the thirdparty files into the thirdparty directory,
- [ ] Fix memory leaks.
Hooray! I will review as I can.
Can you rebase to master and apply the pre-commit run -a to format the code?
In asset meeting: we should focus on getting this in for BC6H for light maps
In asset meeting: we should focus on getting this in for BC6H for light maps
BC6 support is pretty much finished, it just needs testing. I think I'm going to make a separate PR which only implements that format so it can be merged early on for 4.4, while this one with a full integration can be merged later.
Closing as this is superseded by #91535 and #95915