You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
core/command_queue_mt: Customizable size and tests
Adds unit tests for command_queue_mt.h/cpp In this revision, some unit tests will fail due to issue #42107.
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "command_queue_mt.h"
|
||||
|
||||
#include "core/os/os.h"
|
||||
#include "core/project_settings.h"
|
||||
|
||||
void CommandQueueMT::lock() {
|
||||
mutex.lock();
|
||||
@@ -94,6 +95,10 @@ tryagain:
|
||||
}
|
||||
|
||||
CommandQueueMT::CommandQueueMT(bool p_sync) {
|
||||
command_mem_size = GLOBAL_DEF_RST("memory/limits/command_queue/multithreading_queue_size_kb", DEFAULT_COMMAND_MEM_SIZE_KB);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/command_queue/multithreading_queue_size_kb", PropertyInfo(Variant::INT, "memory/limits/command_queue/multithreading_queue_size_kb", PROPERTY_HINT_RANGE, "1,4096,1,or_greater"));
|
||||
command_mem_size *= 1024;
|
||||
command_mem = (uint8_t *)memalloc(command_mem_size);
|
||||
if (p_sync) {
|
||||
sync = memnew(Semaphore);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user