summaryrefslogtreecommitdiff
path: root/modules/basis_universal
AgeCommit message (Collapse)Author
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-31Fix more -Wmaybe-uninitialized warnings with target=release_debugRémi Verschelde
I have no idea why those don't get triggered in target=debug builds. Fixes #37461.
2020-03-30Fix another batch of -Wmaybe-uninitialized warningsRémi Verschelde
And simplify code in CSGShape.
2020-03-30SCons: Format buildsystem files with psf/blackRémi Verschelde
Configured for a max line length of 120 characters. psf/black is very opinionated and purposely doesn't leave much room for configuration. The output is mostly OK so that should be fine for us, but some things worth noting: - Manually wrapped strings will be reflowed, so by using a line length of 120 for the sake of preserving readability for our long command calls, it also means that some manually wrapped strings are back on the same line and should be manually merged again. - Code generators using string concatenation extensively look awful, since black puts each operand on a single line. We need to refactor these generators to use more pythonic string formatting, for which many options are available (`%`, `format` or f-strings). - CI checks and a pre-commit hook will be added to ensure that future buildsystem changes are well-formatted.
2020-03-27Renaming of servers for coherency.Juan Linietsky
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
2020-03-27Fix some -Wmaybe-uninitialized warningsRémi Verschelde
Namely: ``` modules/basis_universal/register_types.cpp: In function 'Ref<Image> basis_universal_unpacker(const Vector<unsigned char>&)': modules/basis_universal/register_types.cpp:266:15: warning: 'imgfmt' may be used uninitialized in this function [-Wmaybe-uninitialized] 266 | image->create(info.m_width, info.m_height, info.m_total_levels > 1, imgfmt, gpudata); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ modules/basis_universal/register_types.cpp:255:39: warning: 'format' may be used uninitialized in this function [-Wmaybe-uninitialized] 255 | bool ret = tr.transcode_image_level(ptr, size, 0, i, dst + ofs, level.m_total_blocks - i, format); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` ``` servers/visual_server.cpp: In member function 'Error VisualServer::_surface_set_data(Array, uint32_t, uint32_t*, uint32_t, Vector<unsigned char>&, int, Vector<unsigned char>&, int, AABB&, Vector<AABB>&)': servers/visual_server.cpp:636:15: warning: 'iw' may be used uninitialized in this function [-Wmaybe-uninitialized] 636 | copymem(&iw[i * 2], &v, 2); | ^ ``` ``` core/image.cpp: In member function 'Error Image::generate_mipmap_roughness(Image::RoughnessChannel, const Ref<Image>&)': core/image.cpp:1683:11: warning: 'roughness' may be used uninitialized in this function [-Wmaybe-uninitialized] 1683 | float roughness; | ^~~~~~~~~ ```
2020-03-23Adding missing include guards to header files identified by LGTM.Rajat Goswami
This addresses the issue godotengine/godot#37143
2020-03-11Fix basis_universal to not include tool main file.Fabio Alessandrelli
Avoid build error due to duplicate `main` symbol definition.
2020-02-18Fix compilation warnings and re-enable werror=yes on TravisRémi Verschelde
Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings raised by GCC 8 and 9. Fix -Wunused-function, -Wunused-private-field and -Wtautological-constant-out-of-range-compare raised by Clang. Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison operation). GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising errors and will thus not abort compilation with `werror=yes`. Treat glslang headers are system headers to avoid raising warnings. Re-enables us to build with `werror=yes` on Linux and macOS, thus catching warnings that would be introduced by new code. Fixes #36132.
2020-02-18PoolVector is gone, replaced by VectorJuan Linietsky
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
2020-02-14Fix various GCC compilation warnings after Vulkan mergeRémi Verschelde
Part of #36132.
2020-02-13basis_universal: Update to upstream commit from Jan 4, 2020Rémi Verschelde
BinomialLLC/basis_universal@895ee8ee7e04f22267f8d16d46de04d5a01d63ac.
2020-02-11Vulkan: Move thirdparty code out of drivers, style fixesRémi Verschelde
- `vk_enum_string_helper.h` is a generated file taken from the SDK (Vulkan-ValidationLayers). - `vk_mem_alloc.h` is a library from GPUOpen: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
2020-02-11Fix code formatting issues and VS compilationRémi Verschelde
Also temporarily disable multicheck build so that we get a full build even when there are style issues on Vulkan. Fixes #33356.
2020-02-11basis_universal: Use proper basisu_transcoder.h header, fixes Clang buildRémi Verschelde
Also renames bu to basisu to be more explicit and match upstream name.
2020-02-11Fixes to Basis Universal.Juan Linietsky
2020-02-11basis_universal: Fix py3 build and document license and provenanceRémi Verschelde
Also drop unneeded files. Fix build with MinGW. Closes #32384.
2020-02-11Rewritten StreamTexture for better code reuse, added basis universal supportJuan Linietsky