Repository navigation
Conversation
724df7f to
8a25d23
Compare
be380d9 to
55b2df1
Compare
55b2df1 to
d223dbf
Compare
dustinspace217
left a comment
There was a problem hiding this comment.
Ran this on desktop (no change, no cache files) and forced the transcode path on Mesa by hiding S3TC/BPTC: textures look right, and one SM1-01 load wrote 5,840 cache files (243 MB). A few things:
- On Vulkan this needs #7699: master's
vulkan_preloadhas no ETC2 case, so a transcoded texture goes up as 32-bit BGRA and reads well past its buffer. Worth saying so in the description and keeping it draft until #7699 lands. - The cache key only checks the first 64 KB. A DDS file's length is set by its size, format and mips, so a repainted texture keeps the same length and reuses the old transcode (across mods too, since the folder is shared).
cf_chksum_longover the whole file, plus the etcpak revision in the tag, would cover it. - With
-portable_modethere's no user root, so the startup prune'scf_get_file_listpasses an empty path intocf_get_list_of_files, which doespath.back()on it. That runs on every portable start, even on desktop. AddingCF_LOCATION_ROOT_GAMElike the shader cache does fixes it. - The cap is only enforced at startup, so it gets passed after about a dozen mission loads. Pruning after writes, or touching the mtime on a hit, would help.
- Smaller:
- bound
stored_sizeto the payload size in the reader; - the mip halving also halves the reported size of 2D art, so maybe tie it to the existing texture-detail setting;
- reuse the existing Vulkan format probe;
- drop the unused
ProcessDxtcfiles; - add
CAPABILITY_ETC2togr_capabilities[].
- bound
|
-ProcessDxtc is keep because it will be used in ta future PR to add the inverse path of ETC2->BCn in ktxutils. There is no ETC2 support in desktop gpus, so someone making a mobile-first mod including ktx/etc2 textures will need something similar to this in ktxutils for vulkan. This is why the cache system is intended to be used for both. ill work on that one after this and #7699 are merged. -Pruning while writting may cause additional problems, on top of deleting cache files that might be used in the current load. What i would want and It might be a good idea is to run it at the end of mission load, as the last step, but i dont know how to do it. -"add CAPABILITY_ETC2 to gr_capabilities[]." where? i belive i already added to all relevant places. -You are 100% sure the change in in the 2nd point is needed to avoid a cache colision? its easy to change, i priorised speed, i was worried that doing checksum over the entire file would slow down mission load even more. -On the first point, yes, this is intended to go after #7699, i was not worried too much as the only real use is android devices and i expected both PRs to be in in the same stable release. And 7699 to be merged earlier. |
|
Thanks.
|
Allright, of the requested changes i did: -Added CF_LOCATION_ROOT_GAME to cache location flags. What i did not do: Please check. Also remember i need to set the localization ids before merging on this one. |
Mobile GPUs might not have S3TC or BPTC, while it has become more common on Adreno 800s and Mali V5 Valhall you can never be sure, and support on older gen gpus is rare.
The objective of this PR is to do transcoding when the bitmap data is requested, if ETC2 support is present. Impact on loading times, specially for missions with a lot of ships and weapons are noticeable, but usable. Additionally a transcoding cache is added so you will only transcode a texture once, unless it is evicted from cache due to size limitation.
This process is about the same used by the bcn_layer that pc games emulators for android uses. And has been optimised for transcode speed and smallest vram usage over quality.
Current Features: