1
0
Fork 0
godot/modules
HP van Braam cccd2432c3 Refactor CommandQueueMT to use vararg templates
In order to make CommandQueueMT more maintainable this PR changes the
previous macro hell with variadic templates instead. This makes the
class far more explicit and will allow us to more easily change the way
the class functions in the future.

Furthermore this refactoring has allowed for some optimizations. In
particular by using std::forward to delay the decision of decaying the
type to as late as possible we are able to move the data from the
callsite into our Command buffer and later move it to the call.

In practice what this means is that compared to the old version instead
of copying values 3 times, we can now get away with 1 copy, and 1 move
for lvalues, and just 2 moves for rvalues. This saves quite a few
operations in a hot codepath.

We also now test to make sure that the amount of copies and moves are
what we expect. This way we can spot performance regressions in this
code easily.

Somewhat unscientifically, running TPS-demo by pressing enter and not
touching the controls average mspf, repeatable across many runs:

before: 6.467
after : 6.202
2025-01-02 15:35:08 +01:00
..
astcenc SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
basis_universal basis_universal: Clarify encoder-only dependencies, only used in editor builds 2024-12-05 21:01:58 +01:00
bcdec bcdec: Fix logic for detecting incomplete blocks 2024-12-14 17:57:44 +01:00
betsy Refactor CommandQueueMT to use vararg templates 2025-01-02 15:35:08 +01:00
bmp SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
camera Remove unused headers in servers. 2024-12-20 18:51:01 +08:00
csg Merge pull request #100526 from fire/vsk-csg-warnings-update 2024-12-17 23:00:17 +01:00
cvtt Image: More cleanup and reduced code duplication. 2024-12-12 11:52:59 +01:00
dds Round DDS width/height to next divisor multiple for block compression 2024-11-25 12:55:05 -05:00
enet Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
etcpak SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
fbx Merge pull request #93401 from Repiteo/style/clang-tidy-fixes 2024-11-04 21:52:05 -06:00
freetype SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
gdscript Merge pull request #100610 from YYF233333/style 2024-12-20 23:56:58 +01:00
glslang SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
gltf Merge pull request #98385 from RandomShaper/thread_yield 2024-12-20 23:56:39 +01:00
godot_physics_2d Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
godot_physics_3d Merge pull request #99901 from adamscott/local_shape-fix 2024-12-02 15:52:08 +01:00
gridmap Make editor's shortcut names translated on-site 2024-12-18 13:00:30 +08:00
hdr SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
interactive_music Fix order initialization to allow initial_clip to be properly played 2024-12-18 15:24:20 +01:00
jolt_physics Merge pull request #100473 from opsocket/fix-rigid-bodies-damping 2024-12-19 19:59:39 -06:00
jpg SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
jsonrpc SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
ktx SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
lightmapper_rd Add transparency support for LightmapGI 2024-12-18 19:36:16 +01:00
mbedtls [mbedTLS] Keep reading/writing partial until "would block" 2024-11-09 17:20:10 +01:00
meshoptimizer Rewrite index optimization code for maximum efficiency 2024-11-04 06:58:06 -08:00
minimp3 Allow passing UID to importer 2024-11-11 15:22:42 +01:00
mobile_vr Set clang-format `RemoveSemicolon` rule to `true` 2024-10-25 13:49:43 -04:00
mono [.NET] Update required .NET SDK version in error messages 2024-12-20 21:57:38 +01:00
msdfgen SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
multiplayer Make editor's shortcut names translated on-site 2024-12-18 13:00:30 +08:00
navigation Fix early navigtion path return 2024-12-19 01:21:38 +01:00
noise Rename internal EditorPlugin icon/name to match exposed methods 2024-12-15 17:31:01 -08:00
ogg SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
openxr Make editor's shortcut names translated on-site 2024-12-18 13:00:30 +08:00
raycast SCons: Properly set SSE2 as baseline on x86_32 2024-12-12 22:44:44 +01:00
regex RegEx: Fix handling of unset/unknown capture groups 2024-11-30 13:35:49 +03:00
svg thorvg: Update to 0.15.5 2024-12-04 17:24:43 +01:00
text_server_adv [TextServer] Fix use of `find_char` in text servers 2024-12-19 21:44:30 -05:00
text_server_fb [TextServer] Fix use of `find_char` in text servers 2024-12-19 21:44:30 -05:00
tga Don't include `core/io/image.h` in `core/os/os.h` 2024-10-18 19:04:19 +03:00
theora SCons: Fix MSVC bypassing disabled warnings 2024-12-09 11:49:42 -06:00
tinyexr Don't include `core/io/image.h` in `core/os/os.h` 2024-10-18 19:04:19 +03:00
upnp Fix broken includes when compiling with builtin_miniupnpc=false 2024-11-27 15:37:54 +00:00
vhacd SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
vorbis Allow passing UID to importer 2024-11-11 15:22:42 +01:00
webp Style: Apply `clang-tidy` fixes (superficial) 2024-11-04 12:11:14 -06:00
webrtc Set clang-format `RemoveSemicolon` rule to `true` 2024-10-25 13:49:43 -04:00
websocket [WebSocket] Clarify that connect_to_url is non-blocking 2024-11-27 13:31:28 +01:00
webxr Set clang-format `RemoveSemicolon` rule to `true` 2024-10-25 13:49:43 -04:00
xatlas_unwrap SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
zip Add a code sample that extracts all files to ZIPReader documentation 2024-12-03 00:37:50 +01:00
SCsub Use scons to calculate all the sources needed for vsproj generation. 2024-11-21 11:11:35 +01:00
register_module_types.h