taisei/src/util/meson.build

62 lines
1.4 KiB
Meson
Raw Normal View History

util_deps = []
util_src = files(
'assert.c',
'crap.c',
'env.c',
'fbmgr.c',
'fbpair.c',
'fbutil.c',
'geometry.c',
'graphics.c',
'io.c',
'kvparser.c',
'miscmath.c',
'pngcruft.c',
'rectpack.c',
Texturing overhaul: GPU compression, sRGB sampling, swizzles, etc. (#240) * WIP compressed textures, swizzles, sRGB sampling, ... * refactor texture type info & fix random bugs * fix preprocessing of sRGB textures * handle y-flipped basis textures * glcommon: better WebGL compat for compressed format detection * missed WEBGL_compressed_texture_pvrtc * implement compressed texture xcoding and uploading * Add basis_universal submodule * Reorganize texture loader code Clean up some code Isolate Basis Universal loader into a separate module * Add wrapper script for encoding .basis textures * basisu: honor custom metadata written by the mkbasis.py script * mkbasis.py: add --incredibly-slow and --dry-run * Move pixmap code from util/ to pixmap/ * Add an on-disk transcode cache for basis textures to speed up loads * Compress texture cache with zlib * Use readable format names for basisu cache filenames * basisu: mip bias test code * basisu: small caching cleanup * add TAISEI_BASISU_MIP_BIAS env variable * Improve OpenGL format matching heuristics * Document considerations for compressed format priority * Remove dead code * Enable two forgotten formats, BC3_RGBA and ATC_RGBA Also prefer BC7 over BC1/BC3 * Recognize GL_ANGLE_compressed_texture_etc for ETC2 textures * Default depth buffers to 24-bit; remove ANGLE hack * Fix glcommon_check_extension for GLES2/legacy gl * Add renderer feature bit for texture swizzle masks * glcommon: Fixup internal formats for GLES2 Sized internal formats are not allowed in GLES2 * Fix emscripten compile errors * Update basis_universal * remove more dead code * revert irrelevant stage4 change * shut up UBSan * basisu: shut up some debug spam * Add normalmap sampling helper to util.glslh * basisu: add a gray-alpha mode * mkbasis.py: Abort if image dimansions aren't multiples of 4 * Add basic Basis Universal encoding documentation (WIP) * doc/basisu: Add paragraph about modes; minor tweaks * basisu: workarounds for GL texture size requirements * gles20: fix uncompressed sRGB formats * Partial workaround for missing swizzles in gles2 and webgl * remove invalid assertion * New renderer API to expose glDrawBuffers-like functionality * stagedraw: disable all color outputs for copy_depth pass required for WebGL compatibility * support GL_ANGLE_request_extension * emscripten: include *.basis in gfx package Also fix a potential problem when more than one .pkgdir is used to construct emscripten packages * Don't rely on emscripten runtime to enable webgl extensions
2020-08-15 13:51:12 +02:00
'strbuf.c',
'stringops.c',
)
if is_developer_build
util_src += files('debug.c')
endif
2019-02-08 20:12:52 +01:00
config.set('TAISEI_BUILDCONF_USE_DESIGNATED_INIT', cc.compiles(
'struct { int dummy; } __attribute__((designated_init)) x;',
name : '__attribute__((designated_init)) with -Werror',
args : ['-Wattributes', '-Werror']
))
Some compatibility fixes for Elbrus compiler (and others based on EDG front end) (#157) * Reduce alignment to 16 due to stack variables alignment On some archs (e.g. elbrus) there is no possibility to align variables on stack by more that 16 bytes. * Added check for -Wno-typedef-redefinition In C11, there is legal to redefine typedef with the same type, but some compilers like elbrus's lcc and, probably, intel's icc generate a warning about that. So we disable it. * Typo fix * Fix __builtin_unreachable() warning on some frontends like EDG * Added check for __attribute__((designated_init)) It doesn't work for elbrus'c lcc and clang; but clang does not generate warning by default, but we still disable it just in case. * A hack to avoid -Wtype-limits for compilers with unsigned enums * Rewritten unreachable __builtin_unreachable() behavior. According to https://bugs.llvm.org/show_bug.cgi?id=13910, old clang versions also suffer from this issue along with lcc. And also this warning option is removed from gcc since 4.5.0, and it's likely there is no unreachable code analysis at all: https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Warning-Options.html * Fixed unneeded stray UNREACHABLE which caused warnings * Removed alignas() which is unneeded after lowering alignment requirements * Removed a hack of -Wunreachable-code disabling on certain compilers Actually, there was a wrong opinion that most of unreachable code warnings are produced by __builtin_unreachable() itself, not the certain use of it. After commit 36493d3, it is finally figured out that it wasn't the case. * Added dummy element to a struct in a test for designated_init This test will enexpectedly fail when GNU extensions are not available
2019-02-07 09:11:13 +01:00
use_libcrypto = get_option('use_libcrypto')
if use_libcrypto == 'auto'
use_libcrypto = dep_crypto.found()
else
use_libcrypto = (use_libcrypto == 'true')
endif
if use_libcrypto
assert(dep_crypto.found(), 'use_libcrypto forced but libcrypto not found. Install OpenSSL or disable use_libcrypto.')
util_src += files('sha256_openssl.c')
util_deps += [dep_crypto]
else
util_src += files('sha256.c')
endif
if host_machine.system() == 'windows'
# NOTE: Even if we ever build this with something like Midipix, we'd
# probably still want to use the winapi implementation of this here.
util_src += files('platform_win32.c')
else
# No have_posix check, it might just work.
util_src += files('platform_posix.c')
endif
2020-11-19 00:12:51 +01:00
if dep_gamemode.found()
util_src += files('gamemode.c')
else
util_src += files('gamemode_stub.c')
endif