You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-26 15:46:23 +00:00
Mark pipeline compilation of ubershaders as high priority.
This commit is contained in:
@@ -92,7 +92,7 @@ public:
|
||||
}
|
||||
|
||||
// Start compilation of a pipeline ahead of time in the background. Returns true if the compilation was started, false if it wasn't required. Source is only used for collecting statistics.
|
||||
void compile_pipeline(const Key &p_key, uint32_t p_key_hash, RS::PipelineSource p_source) {
|
||||
void compile_pipeline(const Key &p_key, uint32_t p_key_hash, RS::PipelineSource p_source, bool p_high_priority) {
|
||||
DEV_ASSERT((creation_object != nullptr) && (creation_function != nullptr) && "Creation object and function was not set before attempting to compile a pipeline.");
|
||||
|
||||
MutexLock local_lock(local_mutex);
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
#endif
|
||||
|
||||
// Queue a background compilation task.
|
||||
WorkerThreadPool::TaskID task_id = WorkerThreadPool::get_singleton()->add_template_task(creation_object, creation_function, p_key, false, "PipelineCompilation");
|
||||
WorkerThreadPool::TaskID task_id = WorkerThreadPool::get_singleton()->add_template_task(creation_object, creation_function, p_key, p_high_priority, "PipelineCompilation");
|
||||
compilation_tasks.insert(p_key_hash, task_id);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
|
||||
if (e == nullptr) {
|
||||
// Request compilation. The method will ignore the request if it's already being compiled.
|
||||
compile_pipeline(p_key, p_key_hash, p_source);
|
||||
compile_pipeline(p_key, p_key_hash, p_source, p_wait_for_compilation);
|
||||
|
||||
if (p_wait_for_compilation) {
|
||||
wait_for_pipeline(p_key_hash);
|
||||
|
||||
Reference in New Issue
Block a user