Commit graph

2288 commits

Author SHA1 Message Date
Rémi Verschelde
4b5b60de85
Merge pull request #39189 from touilleMan/issue-38925
Unify OS.get_system_time_* and OS.get_unix_time
2020-06-15 23:57:16 +02:00
Yuri Roubinsky
1a7e101324 Fix shader's length() function parsing in expressions 2020-06-03 19:39:48 +03:00
Rémi Verschelde
5e62a2ee75 Vulkan: Initialize struct members on declaration
Supersedes and closes #38945.
2020-06-03 13:18:22 +02:00
Emmanuel Leblond
c6de3872f9
Remove OS.get_system_time_secs/get_system_time_msecs and change OS.get_unix_time return type to double 2020-05-31 14:19:31 +02:00
Nathan Franke
e48fb01d59
fix(Directory): remove erasing print
Fixes #39106
2020-05-28 05:46:01 -05:00
CJ DiMaggio
66a294d459 Delete DummyMesh when RasterizerStorageDummy is freed 2020-05-20 21:23:37 -04:00
Fabio Alessandrelli
90c7102b51 Move mix_rate, ouput_latency to AudioDriverManager
Each driver used to define the (same) project settings values
`audio/mix_rate` and `audio/output_latency`, but the setting names are
not driver specific.
Overriding is still possible via platform tags.
2020-05-18 13:02:06 +02:00
Rémi Verschelde
4f23215395
Merge pull request #38750 from madmiraal/fix-vulkan-uninitialized-warning
Silence mulitple may be used uninitialized warnings in RenderingDeviceVulkan::uniform_set_create()
2020-05-15 18:02:56 +02:00
Marcel Admiraal
8f0b3392c3 Silence mulitple may be used uninitialized warnings in
RenderingDeviceVulkan::uniform_set_create()
2020-05-15 11:48:06 +01:00
Rémi Verschelde
0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde
07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
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-05-14 16:54:55 +02:00
Rémi Verschelde
dcd1151d77 Enforce use of bool literals instead of integers
Using clang-tidy's `modernize-use-bool-literals`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
2020-05-14 13:45:01 +02:00
Rémi Verschelde
1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Fabio Alessandrelli
2dbd227c9a Fix DummyRenderer after new lightmapper merge. 2020-05-11 18:26:06 +02:00
Rémi Verschelde
32133a11b5
Merge pull request #38386 from reduz/new-lightmapper
New GPU lightmapper
2020-05-11 13:45:48 +02:00
Juan Linietsky
1bea8e1eac New lightmapper
-Added LocalVector (needed it)
-Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too)
-Fixes and changes all around the place
-Added library for 128 bits fixed point (required for Delaunay3D)
2020-05-10 15:59:09 -03:00
Fabio Alessandrelli
11a81341fa Restore RasterizerDummy. 2020-05-10 18:19:23 +02:00
Rémi Verschelde
69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
Rémi Verschelde
e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
Pedro J. Estébanez
f7706659b5 Improve shader time roll over
- Resurrect it for GL ES 2
- Add it to the Vulkan rasterizer
- Expose the setting from the `RenderingServer`, since it does not belong in any specific rasterizer
2020-04-30 11:42:11 +02:00
Rémi Verschelde
0bf6a86db4
Merge pull request #37795 from Chaosus/shader_fix_const_order2
Fix shader constant sorting
2020-04-29 09:41:34 +02:00
bruvzg
b5caa2e8b0
[Vulkan] Use VK_LAYER_KHRONOS_validation instead of deprecated VK_LAYER_LUNARG_standard_validation. 2020-04-26 16:47:25 +03:00
Rémi Verschelde
2074b43c6f
Merge pull request #36083 from Calinou/dummy-loader-add-extensions
Add more extensions to the dummy texture loader
2020-04-23 12:05:38 +02:00
Juan Linietsky
f8ef38efed Add proper type to most public API uses of Array 2020-04-21 12:16:45 -03:00
Juan Linietsky
ae09b55a19 Exposed RenderingDevice to script API
Also added an easier way to load native GLSL shaders.

Extras:

Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload.

Note:

The precommit hooks are broken because they don't seem to support enums from one class being used in another.
Feel free to fix this after merging this PR.
2020-04-20 21:21:58 -03:00
Rémi Verschelde
b4855f5c83
Merge pull request #38056 from clayjohn/GLES2-depth-buffer
Use proper depth buffer format for rgba shadows
2020-04-20 23:47:24 +02:00
clayjohn
123dd390e4 Use proper depth buffer format for rgba shadows 2020-04-20 11:58:59 -07:00
Juan Linietsky
49d0c6a5c9 Ability to create local RenderingDevice instances. 2020-04-18 21:47:17 -03:00
qarmin
943ec79859 Fixes leaks in ResourceCache, Vulkan and X11 2020-04-15 10:27:57 +02:00
Rémi Verschelde
84142f6a5f
Merge pull request #37881 from qarmin/leak_vulkan
Fixes leaks with Vulkan device and instance
2020-04-14 21:45:48 +02:00
qarmin
2ab4b054e0 Fixes leaks with Vulkan device and instance 2020-04-14 20:15:48 +02:00
Juan Linietsky
5944eb6e7f Implement decals
Also implemented decal atlas, so projectors and other stuff can be added.
Sidenote: Had to make RID hashable, so some unrelated includes changed
in order to include it in hashfuncs.h
2020-04-14 11:13:34 -03:00
Juan Linietsky
a57dc398db Implement MSAA 2020-04-12 15:33:57 -03:00
Juan Linietsky
9dc19f7619
Merge pull request #37808 from reduz/port-effects-to-compute
Moved most of the effect code to compute.
2020-04-11 23:38:05 -03:00
Juan Linietsky
d81911490b Moved most of the effect code to compute.
Simplifies it and improves performance.
Improves image barrier handling per mipmap on RenderingDeviceVulkan
2020-04-11 19:44:07 -03:00
Yuri Roubinsky
bc30f541e6 Fix shader constant sorting 2020-04-11 12:40:17 +03:00
Juan Linietsky
d06f8ef75a Shows proper scene render time in editor info
Also fixed GPU profiler, which was not working on nvidia hardware.
2020-04-10 14:19:30 -03:00
PouleyKetchoupp
802bbe87ad Fix extra warnings in Android build 2020-04-10 11:06:11 +02:00
Rémi Verschelde
23d786d6fb
Merge pull request #36919 from nekomatata/android-vulkan-rendering
Vulkan rendering support on Android
2020-04-09 00:16:26 +02:00
Hugo Locurcio
3007c7e2a3 Add more extensions to the dummy texture loader
This should make headless exporting work in projects using textures
in any format.

Error messages should no longer appear when running a project
that used image formats that were previously not present in the list.
2020-04-08 16:55:20 +02:00
PouleyKetchoupp
e167af3737 Display Server support 2020-04-08 01:47:09 +02:00
clayjohn
3db61ce91c Avoid material rebinds when using skeletons 2020-04-07 10:34:35 -07:00
Rémi Verschelde
597ec5dbf8
Merge pull request #37586 from qarmin/vulkan_allocator_leak
Fix leak with Vulkan allocator
2020-04-07 09:16:02 +02:00
Rémi Verschelde
befbdda7f2
Merge pull request #37635 from qarmin/leak_vertex
Fixed leak with vertex_formats
2020-04-06 21:32:25 +02:00
qarmin
f4301b7259 Fixed leak with vertex_formats 2020-04-06 18:07:31 +02:00
Rémi Verschelde
61342e5831 Vulkan: Use VK_NULL_HANDLE for handles, fixes 32-bit builds
Some Vulkan types are defined as "non dispatchable handles" and use a
different typedef on 32-bit and 64-bit systems (struct pointer on
64-bit, `uint64_t` otherwise).

0e78ffd1dc/include/vulkan/vulkan_core.h (L59-L65)

Contrarily to `NULL`, `nullptr` can't be converted to `uint64_t` so
build was now failing on 32-bit after converting the codebase from
using `NULL` to `nullptr`.

Fixes #37620.
2020-04-06 10:21:32 +02:00
qarmin
a0832e6f5e Fix leak with Vulkan allocator 2020-04-04 20:16:48 +02:00
PouleyKetchoupp
af424b1c7c Vulkan rendering for Android 2020-04-03 11:18:59 +02:00
lupoDharkael
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00