-
Notifications
You must be signed in to change notification settings - Fork 107
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
Texturing overhaul: GPU compression, sRGB sampling, swizzles, etc. #240
Conversation
4df7e89
to
e94d314
Compare
Clean up some code Isolate Basis Universal loader into a separate module
Also prefer BC7 over BC1/BC3
required for WebGL compatibility
Also fix a potential problem when more than one .pkgdir is used to construct emscripten packages
cfa27bc
to
7724e4c
Compare
@@ -495,3 +509,22 @@ uint64_t umuldiv64(uint64_t x, uint64_t multiplier, uint64_t divisor) { | |||
uint64_t uceildiv64(uint64_t x, uint64_t y) { | |||
return x / y + (x % y != 0); | |||
} | |||
|
|||
int popcnt32(uint32_t x) { | |||
#if TAISEI_BUILDCONF_HAVE_BUILTIN_POPCOUNT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an inconsistency here between how this is defined by meson (without a value) in build_config.h, and by src/util/compat.h, which can lead to build failures (e.g. https://travis-ci.com/github/jon-turney/meson-corpus-test/jobs/384217603#L4514)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks; should be fixed in 0e25c3a. But I do have to wonder how you managed to trigger this condition in the first place - does the compiler really not have __builtin_popcount
, or is that a Meson bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compiler I tested with does have __builtin_popcount.
I think this issue here is that the behaviour of meson when using the set()
method of a configuration data object with a boolean value is not what you are expecting.
https://mesonbuild.com/Configuration.html#configuring-without-an-input-file
Perhaps you want to use set10
here instead, depending on what you've decided the meaning of this define is?
https://mesonbuild.com/Reference-manual.html#configuration-data-object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware of how the set
method works, that's what I want. I just accidentally wrote #if
in place of #ifdef
.
Disregard my previous comment by the way; I just realized that the error happens when __builtin_popcount is found, since the macro just expands into an empty space. It's strange that neither GCC (10.2.1) nor clang (10.0.1) produce this error on my system however, otherwise I definitely should've caught this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR, this is a Ubuntu 20.04 (focal) VM, and the compiler is gcc (Ubuntu 9.3.0-3ubuntu1) 9.3.0
.
Note: base branch is set tostage4bg
for a cleaner diff, since this is what I've been testing against. It will be rebased onto master before merging.Support for various GPU compression formats is achieved by integrating the Basis Universal transcoder. Unfortunately, this is C++ code. I have written a basic C API wrapper for it to avoid introducing C++ into Taisei itself. The wrapper resides in our basis_universal fork.
Rough TODO:
.basis
loading code into a separate file..basis
support optional in the engine..basis
files into.png
/.webp
at build time if support is disabled..basis
textures more straightforward..basis
textures.