-
Notifications
You must be signed in to change notification settings - Fork 184
GLideNHQ: zstd compression for texture cache #2960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@GhostlyDark I totally agree with your idea to add support of zstd compression. I briefly checked the modification you made in GLideN64 sources, they look correct. I even think that we can left UI unchanged and silently use zstd instead of zlib if it is supported. The only thing which concerns me in this PR is include of zstd sources to GLideN64. IMO, it is overkill. Did you make it for draft only? I think, this library should be used the same way as we use other external libraries: freetype, libpng, zlib. |
Then we'll go this route. The
I agree to this. I opened this as a draft, hoping for some input on how the implementation should look like. I think it's also part of the reason why GitHub actions are failing. I'll definitely adjust this.
In such a case, the |
77f27b0 to
02cf1d0
Compare
d9cab97 to
a9f3f54
Compare
|
@gonetz I tried a couple of different things, but I keep struggling with getting Visual Studio to work correctly. It either doesn't compile or if it does, ZSTD is somehow not included in the GLideN64 binary - the latter being the case for the current Windows GitHub Action builds. The |
fc26331 to
be5c125
Compare
|
It's possible that QtZlib and zlibWrapper conflict as they both use |
|
@gonetz That aside, there's a few things I want to discuss:
|
This adds zstd compression support. Closes #2913.
Currently it's simply using the
zlibWrapperto support bothzlibandzstdcompression streams. For testing purposes, the compression level is cranked up to level 9.Initial size comparisons (HTS cache) for OoT Reloaded texture pack:
uncompressed:
28.5 GB (30.694.669.834 bytes)zlib-level1:
8.28 GB (8 897 605 579 bytes)zstd-level1:
8.69 GB (9 334 399 841 bytes)zstd-level9:
6.80 GB (7 307 463 076 bytes)Higher
zstdcompression levels generally do not affect decompression speeds at all, which is one of the main benefits of zstandard. Do note thatlevel9in this case is just thelevel9compression level ofzlibtranslated by the wrapper, not the actualzstdcompression level (which ranges up to 22).An HTS file using
zstdoutperforms anyzlibcompressed one, reducing stutter quite noticeably. I did however notice that uncompressed cache files still perform better. ThezlibWrappercauses some overhead, so the wrapper itself introduces a performance degradation that otherwise wouldn't be there (unknown by how much exactly).Numbers from the zstd repo, which I believe to be somewhat accurate:
