1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Web: Add godot_pool_size/emscripten_pool_size config

This commit is contained in:
Marcos Casagrande
2025-03-21 20:01:48 +01:00
parent 209a446e36
commit a7d18f51a2
8 changed files with 50 additions and 2 deletions

View File

@@ -61,6 +61,7 @@ const GodotConfig = {
canvas_resize_policy: 2, // Adaptive
virtual_keyboard: false,
persistent_drops: false,
godot_pool_size: 4,
on_execute: null,
on_exit: null,
@@ -70,6 +71,7 @@ const GodotConfig = {
GodotConfig.locale = p_opts['locale'] || GodotConfig.locale;
GodotConfig.virtual_keyboard = p_opts['virtualKeyboard'];
GodotConfig.persistent_drops = !!p_opts['persistentDrops'];
GodotConfig.godot_pool_size = p_opts['godotPoolSize'];
GodotConfig.on_execute = p_opts['onExecute'];
GodotConfig.on_exit = p_opts['onExit'];
if (p_opts['focusCanvas']) {
@@ -346,6 +348,17 @@ const GodotOS = {
return concurrency < 2 ? concurrency : 2;
},
godot_js_os_thread_pool_size_get__proxy: 'sync',
godot_js_os_thread_pool_size_get__sig: 'i',
godot_js_os_thread_pool_size_get: function () {
if (typeof PThread === 'undefined') {
// Threads aren't supported, so default to `1`.
return 1;
}
return GodotConfig.godot_pool_size;
},
godot_js_os_download_buffer__proxy: 'sync',
godot_js_os_download_buffer__sig: 'viiii',
godot_js_os_download_buffer: function (p_ptr, p_size, p_name, p_mime) {