Repository: godotengine/godot (language: cpp)

Issue:
Scenes can't be fully loaded and Godot freezes
### Tested versions

- Reproducible in: v4.4.beta.gh [b607110ad] v4.4.beta3
- Not reproducible in: v4.4.beta1 v4.4.beta2


### System information

Godot v4.4.beta (b607110ad) - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 960 - AMD FX(tm)-6300 Six-Core Processor (6 threads)

### Issue description

In the TPS Demo project, when pressing play on the main menu, Godot finishes the loading bar but then stops responding.
![Image](https://github.com/user-attachments/assets/997fecaf-8778-497b-a187-20bb55c4336e)

Note 1: In beta 1 and 2, it also freezes but eventually responds after a few seconds.

### Steps to reproduce

- Open TPS Demo.
- Press play.

### Minimal reproduction project (MRP)

https://github.com/godotengine/tps-demo


Discussion / hints:
Potentially related to https://github.com/godotengine/godot/issues/101452, note this comment: https://github.com/godotengine/godot/issues/101452#issuecomment-2657817175

Because, again, Windows + Nvidia.

@LiveTrower -- Could you force Godot over OpenGL3 and try again? Launch it from a command line prompt with the command line option: ```--rendering-driver opengl3```
> Potentially related to [#101452](https://github.com/godotengine/godot/issues/101452), note this comment: [#101452 (comment)](https://github.com/godotengine/godot/issues/101452#issuecomment-2657817175)


Or maybe same as https://github.com/godotengine/godot/issues/102812


@Invium-GH It's absolutely true that lately Nvidia drivers have been a total disaster. In fact, I had to install version 561.09 because any version after that would freeze my entire system when using Godot with Vulkan, along with performance issues in d3d12. I even thought it was a bug in Godot until I saw this: [102219](https://github.com/godotengine/godot/issues/102219)
However, regarding this specific issue, I don't think it's the driver, but I'm not entirely sure.
@Invium-GH I tried using the command --rendering-driver opengl3, but the issue persists.
> [@Invium-GH](https://github.com/Invium-GH) I tried using the command --rendering-driver opengl3, but the issue persists.

Thanks for trying. That negates my theory then. But, it kind of confirms @Giganzo 's theory, in this comment -- https://github.com/godotengine/godot/issues/102877#issuecomment-2660878236

A bug which seems under active investigation. So... good news there.
@Invium-GH #102891 is also related.
Can you still reproduce this issue in 4.4.rc1?
@akien-mga Yes, the issue persists. Something corious is that when I open the level.tscn scene in the editor, it loads correctly, but when I run it, it freezes.
Major issues with Godot 4.4 for me. One of my projects freezes on startup, always at the "executing pre-reimport operations" or "(re)importing assets" phase. The cause and fix of this issue keeps changing - sometimes it's an asset, sometimes it's a scene, sometimes it's a combination of various things. This makes it impossible to create an MRP.
![Image](https://github.com/user-attachments/assets/6d4493da-6672-4638-af9a-4436b7c14656)
My project works fine in Godot 4.3-stable.

As for the TPS-demo, it froze permanently when I first started it, but after restarting, loaded (poorly) after that:
![Image](https://github.com/user-attachments/assets/871b37c9-827a-4f41-aad9-cd470017956a)
The demo works fine in Godot 4.3-stable.

I am experiencing this issue in Godot 4.4-rc1 and 4.4-rc2. I don't know about other 4.4 versions because the issue is so sporadic.

**OS:** Windows 11 Home 24H2
**GPU:** NVIDIA GeForce GTX 1050 Ti
**NVIDIA driver versions tested:** 566.36, 572.47
**Rendering drivers tested:** Forward Plus (vulkan), Compatibility (opengl3)

Notably, unlike the original poster, my issue occurs when starting up the project (sometimes when loading a scene, depending on what I remove) not only when playtesting.

Things I tried:
- Deleting the `.godot` folder.
- Deleting the files in `user://`.
- Finding a consistent cause for the issue.
Vulkan 1.3.289 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce GTX 960

Got a stack

edited for brevity
```
Semaphore::wait() Line 80 (core\os\semaphore.h:80)
WorkerThreadPool::wait_for_group_task_completion(__int64 p_group) Line 695 (core\object\worker_thread_pool.cpp:695)
ShaderRD::_compile_version_end(ShaderRD::Version * p_version, int p_group) Line 569 (servers\rendering\renderer_rd\shader_rd.cpp:569)
ShaderRD::_compile_ensure_finished(ShaderRD::Version * p_version) Line 612 (servers\rendering\renderer_rd\shader_rd.cpp:612)
ShaderRD::_clear_version(ShaderRD::Version * p_version) Line 198 (servers\rendering\renderer_rd\shader_rd.cpp:198)
ShaderRD::version_free(RID p_version) Line 709 (servers\rendering\renderer_rd\shader_rd.cpp:709)
RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::~ShaderData() Line 465 (servers\rendering\renderer_rd\forward_clustered\scene_shader_forward_clustered.cpp:465)
RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::`scalar deleting destructor'(unsigned int) (Unknown Source:0)
memdelete<RendererRD::MaterialStorage::ShaderData>(RendererRD::MaterialStorage::ShaderData * p_class) Line 143 (core\os\memory.h:143)
RendererRD::MaterialStorage::shader_free(RID p_rid) Line 1947 (servers\rendering\renderer_rd\storage_rd\material_storage.cpp:1947)
RendererRD::MaterialStorage::free(RID p_rid) Line 1292 (servers\rendering\renderer_rd\storage_rd\material_storage.cpp:1292)
RendererRD::Utilities::free(RID p_rid) Line 94 (servers\rendering\renderer_rd\storage_rd\utilities.cpp:94)
RenderingServerDefault::_free(RID p_rid) Line 48 (servers\rendering\rendering_server_default.cpp:48)
RenderingServerDefault::free(RID p_rid) Line 1131 (servers\rendering\rendering_server_default.h:1131)
BaseMaterial3D::_update_shader() Line 693 (scene\resources\material.cpp:693)
BaseMaterial3D::flush_changes() Line 1966 (scene\resources\material.cpp:1966)
```
> Major issues with Godot 4.4 for me. One of my projects freezes on startup, always at the "executing pre-reimport operations" or "(re)importing assets" phase. [...]

Upgrading to Godot 4.4-rc3 does not fix the issue with my project. The TPS demo also freezes when clicking play and getting to 75%.
When people say it "freezes" what exactly do they mean? Does the demo hang indefinitely, is it just for a few seconds? Do you have to kill the process? I just tried the demo using my slightly custom 4.3 build, as well as 4.4-rc1 and 4.4-rc3 and from the main menu it loads within a second or two and I can play just fine. My system is "Godot v4.4.rc3 - Windows 11 (build 22631) - Single-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (NVIDIA; 32.0.15.6094) - Intel(R) Core(TM) i9-14900KF (32 threads)".

Also tried it on another system here. It does not hang, I do see the progress bar sitting at 75% for less than a second, but it loads fine on "Godot v4.4.rc3 - Windows 11 (build 22631) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 SUPER (NVIDIA; 32.0.15.6094) - Intel(R) Core(TM) i9-9900KS CPU @ 4.00GHz (16 threads)"
> Got a stack

@huwpascoe can you eventually get a trace of the second thread that is likely waiting concurrently ?
I was struggling with this on Godot on iPad this week.  More than once I thought it was a deadlock, and spent hours chasing it, assuming it was specific to me.  But this is the same stack trace.

In the end, I am not sure if it is fixed, but using Stuart’s lazy loading + my own pre baked shaders made the issue go away for me.  It happened on the museum app.

At this point, I like to believe that the issue is that a massive slowdown caused by shader compilation (I shared some stats a few messages ago) and not a real dead lock.  But I could be wrong.

It would help to see all the stack traces for all the threads (on iOS, while I could get all these stack traces, I could never spot the one doing the actual compilation - this is the sole thing that makes me think i have masked rather than fixed the problem).  I even instrumented MutexLock to track it, so I think the issue is fixed, but getting the stack trace on other platforms might help confirm if this is deadlock or just the system overwhelmed with shaders than need compiling
Sorry the stats were shared on the chat group.

Launching the Museum sample creates over 3,600 shaders.  Even on my M2 Ultra compiling took several minutes, it took so long to batch compile that I went to lunch and I didn’t measure the time.  

It produced about 100 megs worth of metal shader code in 20 million lines of code.

Only a fraction of the shaders are used, which is why Stuart’s patch for lazy loading on Mac helps so much.  But I am little troubled that I still have to keep 100 megs worth of text in ram.
> When people say it "freezes" what exactly do they mean? Does the demo hang indefinitely, is it just for a few seconds? Do you have to kill the process?
>
@m4rr5 I mean that the load reaches 100% but it freezes and never responds. The same thing happens if I run the scene directly. On the other hand, what @Joy-less mentioned also occurs, where it reaches 75% and never responds, but that only happens when it has to recompile the pipelines. However, if you wait a few seconds, then kill the process, and finally run it again, it will load normally up to 100%, but the aforementioned issue will still happen. The problem mentioned by @Joy-less has been happening to me since versions prior to v4.4.beta3, but the issue I am reporting now does not occur in that case. I hope I have explained myself clearly, as it seems that all these problems are different.


> Only a fraction of the shaders are used, which is why Stuart’s patch for lazy loading on Mac helps so much. But I am little troubled that I still have to keep 100 megs worth of text in ram.

Godot's approach since 4.0 is to precompile as many shaders as possible on startup, as we don't know in advance which features the project will use. This could be improved by https://github.com/godotengine/godot/pull/102552 though, since it could also gather a list of features in the project that may be used at some point in the project. (It would also need to look through scripts to check for toggleable options though.)

Additionally, the project settings added by https://github.com/godotengine/godot-proposals/issues/5229 could be used to avoid compiling shaders for disabled features. This means you'd get a stutter the first time you enable the feature from the project settings or RenderingServer method, but it's probably acceptable if this happens while in a settings menu, as opposed to during gameplay.

I'm still surprised to see 3,600 unique shaders being compiled in MOAT though. Even with all features enabled in a 3D project with a few dozen materials, I'd expect the number to be a quarter of that at most. There's a chance that project may be using Shader resources in other resources that are marked **Local to Scene**, which will trigger a shader compilation for every instance.
@Flarkk

<details><summary>Thread</summary>

```
Semaphore::wait() Line 80 (core\os\semaphore.h:80)
WorkerThreadPool::wait_for_group_task_completion(__int64 p_group) Line 695 (core\object\worker_thread_pool.cpp:695)
ShaderRD::_compile_version_end(ShaderRD::Version * p_version, int p_group) Line 569 (servers\rendering\renderer_rd\shader_rd.cpp:569)
ShaderRD::_compile_ensure_finished(ShaderRD::Version * p_version) Line 612 (servers\rendering\renderer_rd\shader_rd.cpp:612)
ShaderRD::version_is_valid(RID p_version) Line 702 (servers\rendering\renderer_rd\shader_rd.cpp:702)
RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::is_valid() Line 446 (servers\rendering\renderer_rd\forward_clustered\scene_shader_forward_clustered.cpp:446)
RendererSceneRenderImplementation::RenderForwardClustered::mesh_generate_pipelines(RID p_mesh, bool p_background_compilation) Line 4762 (servers\rendering\renderer_rd\forward_clustered\render_forward_clustered.cpp:4762)
RendererSceneCull::mesh_generate_pipelines(RID p_mesh, bool p_background_compilation) Line 1654 (servers\rendering\renderer_scene_cull.cpp:1654)
RenderingServerDefault::mesh_create_from_surfaces(const Vector<RenderingServer::SurfaceData> & p_surfaces, int p_blend_shape_count) Line 336 (servers\rendering\rendering_server_default.h:336)
ArrayMesh::_set_surfaces(const Array & p_surfaces) Line 1674 (scene\resources\mesh.cpp:1674)
call_with_variant_args_helper<ArrayMesh,Array const &,0>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<0> __formal) Line 315 (core\variant\binder_common.h:315)
call_with_variant_args_dv<ArrayMesh,Array const &>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector<Variant> & default_values) Line 463 (core\variant\binder_common.h:463)
MethodBindT<ArrayMesh,Array const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 347 (core\object\method_bind.h:347)
ClassDB::set_property(Object * p_object, const StringName & p_property, const Variant & p_value, bool * r_valid) Line 1633 (core\object\class_db.cpp:1633)
Object::set(const StringName & p_name, const Variant & p_value, bool * r_valid) Line 284 (core\object\object.cpp:284)
ResourceLoaderBinary::load() Line 874 (core\io\resource_format_binary.cpp:874)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 453 (core\io\resource_format_binary.cpp:453)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 489 (core\io\resource_format_binary.cpp:489)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 502 (core\io\resource_format_binary.cpp:502)
ResourceLoaderBinary::load() Line 828 (core\io\resource_format_binary.cpp:828)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 453 (core\io\resource_format_binary.cpp:453)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 489 (core\io\resource_format_binary.cpp:489)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 502 (core\io\resource_format_binary.cpp:502)
ResourceLoaderBinary::load() Line 828 (core\io\resource_format_binary.cpp:828)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 453 (core\io\resource_format_binary.cpp:453)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 489 (core\io\resource_format_binary.cpp:489)
ResourceLoaderBinary::parse_variant(Variant & r_v) Line 502 (core\io\resource_format_binary.cpp:502)
ResourceLoaderBinary::load() Line 828 (core\io\resource_format_binary.cpp:828)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1908 (core\variant\variant_parser.cpp:1908)
ResourceLoaderText::load() Line 591 (scene\resources\resource_format_text.cpp:591)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::_parse_tag(VariantParser::Token & token, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1818 (core\variant\variant_parser.cpp:1818)
VariantParser::parse_tag(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1842 (core\variant\variant_parser.cpp:1842)
ResourceLoaderText::load() Line 478 (scene\resources\resource_format_text.cpp:478)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1908 (core\variant\variant_parser.cpp:1908)
ResourceLoaderText::load() Line 591 (scene\resources\resource_format_text.cpp:591)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_thread_function(void * p_user) Line 207 (core\object\worker_thread_pool.cpp:207)
Thread::callback(unsigned __int64 p_caller_id, const Thread::Settings & p_settings, void(*)(void *) p_callback, void * p_userdata) Line 66 (core\os\thread.cpp:66)
```
</details>
<details><summary>Thread</summary>

```
MutexLock<MutexImpl<std::recursive_mutex>>::MutexLock<MutexImpl<std::recursive_mutex>>(const MutexImpl<std::recursive_mutex> & p_mutex) Line 78 (core\os\mutex.h:78)
RendererSceneRenderImplementation::SceneShaderForwardClustered::_create_shader_func() Line 470 (servers\rendering\renderer_rd\forward_clustered\scene_shader_forward_clustered.cpp:470)
RendererSceneRenderImplementation::SceneShaderForwardClustered::_create_shader_funcs() Line 297 (servers\rendering\renderer_rd\forward_clustered\scene_shader_forward_clustered.h:297)
RendererRD::MaterialStorage::shader_set_code(RID p_shader, const String & p_code) Line 1990 (servers\rendering\renderer_rd\storage_rd\material_storage.cpp:1990)
RenderingServerDefault::shader_create_from_code(const String & p_code, const String & p_path_hint) Line 257 (servers\rendering\rendering_server_default.h:257)
BaseMaterial3D::_update_shader() Line 1933 (scene\resources\material.cpp:1933)
BaseMaterial3D::get_rid() Line 2941 (scene\resources\material.cpp:2941)
ArrayMesh::_set_surfaces(const Array & p_surfaces) Line 1633 (scene\resources\mesh.cpp:1633)
call_with_variant_args_helper<ArrayMesh,Array const &,0>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<0> __formal) Line 315 (core\variant\binder_common.h:315)
call_with_variant_args_dv<ArrayMesh,Array const &>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector<Variant> & default_values) Line 463 (core\variant\binder_common.h:463)
MethodBindT<ArrayMesh,Array const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 347 (core\object\method_bind.h:347)
ClassDB::set_property(Object * p_object, const StringName & p_property, const Variant & p_value, bool * r_valid) Line 1633 (core\object\class_db.cpp:1633)
Object::set(const StringName & p_name, const Variant & p_value, bool * r_valid) Line 284 (core\object\object.cpp:284)
ResourceLoaderBinary::load() Line 874 (core\io\resource_format_binary.cpp:874)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
PipelineHashMapRD<RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::PipelineKey,RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData,void (__cdecl RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::*)(RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::PipelineKey)>::wait_for_pipeline(unsigned int p_key_hash) Line 151 (servers\rendering\renderer_rd\pipeline_hash_map_rd.h:151)
RendererSceneRenderImplementation::RenderForwardClustered::mesh_generate_pipelines(RID p_mesh, bool p_background_compilation) Line 4799 (servers\rendering\renderer_rd\forward_clustered\render_forward_clustered.cpp:4799)
RendererSceneCull::mesh_generate_pipelines(RID p_mesh, bool p_background_compilation) Line 1654 (servers\rendering\renderer_scene_cull.cpp:1654)
RenderingServerDefault::mesh_create_from_surfaces(const Vector<RenderingServer::SurfaceData> & p_surfaces, int p_blend_shape_count) Line 336 (servers\rendering\rendering_server_default.h:336)
ArrayMesh::_set_surfaces(const Array & p_surfaces) Line 1674 (scene\resources\mesh.cpp:1674)
call_with_variant_args_helper<ArrayMesh,Array const &,0>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<0> __formal) Line 315 (core\variant\binder_common.h:315)
call_with_variant_args_dv<ArrayMesh,Array const &>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector<Variant> & default_values) Line 463 (core\variant\binder_common.h:463)
MethodBindT<ArrayMesh,Array const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 347 (core\object\method_bind.h:347)
ClassDB::set_property(Object * p_object, const StringName & p_property, const Variant & p_value, bool * r_valid) Line 1633 (core\object\class_db.cpp:1633)
Object::set(const StringName & p_name, const Variant & p_value, bool * r_valid) Line 284 (core\object\object.cpp:284)
ResourceLoaderBinary::load() Line 874 (core\io\resource_format_binary.cpp:874)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
ResourceLoader::_load_start(const String & p_path, const String & p_type_hint, ResourceLoader::LoadThreadMode p_thread_mode, ResourceFormatLoader::CacheMode p_cache_mode, bool p_for_user) Line 655 (core\io\resource_loader.cpp:655)
ResourceLoaderText::load() Line 466 (scene\resources\resource_format_text.cpp:466)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::_parse_tag(VariantParser::Token & token, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1818 (core\variant\variant_parser.cpp:1818)
VariantParser::parse_tag(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1842 (core\variant\variant_parser.cpp:1842)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1882 (core\variant\variant_parser.cpp:1882)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::_parse_tag(VariantParser::Token & token, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1818 (core\variant\variant_parser.cpp:1818)
VariantParser::parse_tag(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1842 (core\variant\variant_parser.cpp:1842)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1882 (core\variant\variant_parser.cpp:1882)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoader::load(const String & p_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error) Line 556 (core\io\resource_loader.cpp:556)
GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode * p_preload) Line 4691 (modules\gdscript\gdscript_analyzer.cpp:4691)
GDScriptAnalyzer::reduce_expression(GDScriptParser::ExpressionNode * p_expression, bool p_is_root) Line 2597 (modules\gdscript\gdscript_analyzer.cpp:2597)
GDScriptAnalyzer::resolve_assignable(GDScriptParser::AssignableNode * p_assignable, const char * p_kind) Line 1989 (modules\gdscript\gdscript_analyzer.cpp:1989)
GDScriptAnalyzer::resolve_constant(GDScriptParser::ConstantNode * p_constant, bool p_is_local) Line 2123 (modules\gdscript\gdscript_analyzer.cpp:2123)
GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode * p_class, int p_index, const GDScriptParser::Node * p_source) Line 1113 (modules\gdscript\gdscript_analyzer.cpp:1113)
GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode * p_class, const GDScriptParser::Node * p_source) Line 1319 (modules\gdscript\gdscript_analyzer.cpp:1319)
GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode * p_class, bool p_recursive) Line 1346 (modules\gdscript\gdscript_analyzer.cpp:1346)
GDScriptAnalyzer::resolve_interface() Line 6307 (modules\gdscript\gdscript_analyzer.cpp:6307)
GDScriptAnalyzer::analyze() Line 6341 (modules\gdscript\gdscript_analyzer.cpp:6341)
GDScript::reload(bool p_keep_state) Line 835 (modules\gdscript\gdscript.cpp:835)
GDScriptCache::get_full_script(const String & p_path, Error & r_error, const String & p_owner, bool p_update_from_disk) Line 385 (modules\gdscript\gdscript_cache.cpp:385)
ResourceFormatLoaderGDScript::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 3018 (modules\gdscript\gdscript.cpp:3018)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1908 (core\variant\variant_parser.cpp:1908)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_thread_function(void * p_user) Line 207 (core\object\worker_thread_pool.cpp:207)
Thread::callback(unsigned __int64 p_caller_id, const Thread::Settings & p_settings, void(*)(void *) p_callback, void * p_userdata) Line 66 (core\os\thread.cpp:66)
```
</details>
<details><summary>Thread</summary>

```
MutexLock<MutexImpl<std::recursive_mutex>>::MutexLock<MutexImpl<std::recursive_mutex>>(const MutexImpl<std::recursive_mutex> & p_mutex) Line 78 (core\os\mutex.h:78)
RendererSceneRenderImplementation::SceneShaderForwardClustered::_create_shader_func() Line 470 (servers\rendering\renderer_rd\forward_clustered\scene_shader_forward_clustered.cpp:470)
RendererSceneRenderImplementation::SceneShaderForwardClustered::_create_shader_funcs() Line 297 (servers\rendering\renderer_rd\forward_clustered\scene_shader_forward_clustered.h:297)
RendererRD::MaterialStorage::shader_set_code(RID p_shader, const String & p_code) Line 1990 (servers\rendering\renderer_rd\storage_rd\material_storage.cpp:1990)
RenderingServerDefault::shader_create_from_code(const String & p_code, const String & p_path_hint) Line 257 (servers\rendering\rendering_server_default.h:257)
BaseMaterial3D::_update_shader() Line 1933 (scene\resources\material.cpp:1933)
BaseMaterial3D::get_rid() Line 2941 (scene\resources\material.cpp:2941)
ArrayMesh::_set_surfaces(const Array & p_surfaces) Line 1633 (scene\resources\mesh.cpp:1633)
call_with_variant_args_helper<ArrayMesh,Array const &,0>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<0> __formal) Line 315 (core\variant\binder_common.h:315)
call_with_variant_args_dv<ArrayMesh,Array const &>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector<Variant> & default_values) Line 463 (core\variant\binder_common.h:463)
MethodBindT<ArrayMesh,Array const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 347 (core\object\method_bind.h:347)
ClassDB::set_property(Object * p_object, const StringName & p_property, const Variant & p_value, bool * r_valid) Line 1633 (core\object\class_db.cpp:1633)
Object::set(const StringName & p_name, const Variant & p_value, bool * r_valid) Line 284 (core\object\object.cpp:284)
ResourceLoaderBinary::load() Line 874 (core\io\resource_format_binary.cpp:874)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
PipelineHashMapRD<RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::PipelineKey,RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData,void (__cdecl RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::*)(RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::PipelineKey)>::wait_for_pipeline(unsigned int p_key_hash) Line 151 (servers\rendering\renderer_rd\pipeline_hash_map_rd.h:151)
RendererSceneRenderImplementation::RenderForwardClustered::mesh_generate_pipelines(RID p_mesh, bool p_background_compilation) Line 4799 (servers\rendering\renderer_rd\forward_clustered\render_forward_clustered.cpp:4799)
RendererSceneCull::mesh_generate_pipelines(RID p_mesh, bool p_background_compilation) Line 1654 (servers\rendering\renderer_scene_cull.cpp:1654)
RenderingServerDefault::mesh_create_from_surfaces(const Vector<RenderingServer::SurfaceData> & p_surfaces, int p_blend_shape_count) Line 336 (servers\rendering\rendering_server_default.h:336)
ArrayMesh::_set_surfaces(const Array & p_surfaces) Line 1674 (scene\resources\mesh.cpp:1674)
call_with_variant_args_helper<ArrayMesh,Array const &,0>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<0> __formal) Line 315 (core\variant\binder_common.h:315)
call_with_variant_args_dv<ArrayMesh,Array const &>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector<Variant> & default_values) Line 463 (core\variant\binder_common.h:463)
MethodBindT<ArrayMesh,Array const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 347 (core\object\method_bind.h:347)
ClassDB::set_property(Object * p_object, const StringName & p_property, const Variant & p_value, bool * r_valid) Line 1633 (core\object\class_db.cpp:1633)
Object::set(const StringName & p_name, const Variant & p_value, bool * r_valid) Line 284 (core\object\object.cpp:284)
ResourceLoaderBinary::load() Line 874 (core\io\resource_format_binary.cpp:874)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
ResourceLoader::_load_start(const String & p_path, const String & p_type_hint, ResourceLoader::LoadThreadMode p_thread_mode, ResourceFormatLoader::CacheMode p_cache_mode, bool p_for_user) Line 655 (core\io\resource_loader.cpp:655)
ResourceLoaderText::load() Line 466 (scene\resources\resource_format_text.cpp:466)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::_parse_tag(VariantParser::Token & token, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1818 (core\variant\variant_parser.cpp:1818)
VariantParser::parse_tag(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1842 (core\variant\variant_parser.cpp:1842)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1882 (core\variant\variant_parser.cpp:1882)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::_parse_tag(VariantParser::Token & token, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1818 (core\variant\variant_parser.cpp:1818)
VariantParser::parse_tag(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1842 (core\variant\variant_parser.cpp:1842)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1882 (core\variant\variant_parser.cpp:1882)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoader::load(const String & p_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error) Line 556 (core\io\resource_loader.cpp:556)
GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode * p_preload) Line 4691 (modules\gdscript\gdscript_analyzer.cpp:4691)
GDScriptAnalyzer::reduce_expression(GDScriptParser::ExpressionNode * p_expression, bool p_is_root) Line 2597 (modules\gdscript\gdscript_analyzer.cpp:2597)
GDScriptAnalyzer::resolve_assignable(GDScriptParser::AssignableNode * p_assignable, const char * p_kind) Line 1989 (modules\gdscript\gdscript_analyzer.cpp:1989)
GDScriptAnalyzer::resolve_constant(GDScriptParser::ConstantNode * p_constant, bool p_is_local) Line 2123 (modules\gdscript\gdscript_analyzer.cpp:2123)
GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode * p_class, int p_index, const GDScriptParser::Node * p_source) Line 1113 (modules\gdscript\gdscript_analyzer.cpp:1113)
GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode * p_class, const GDScriptParser::Node * p_source) Line 1319 (modules\gdscript\gdscript_analyzer.cpp:1319)
GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode * p_class, bool p_recursive) Line 1346 (modules\gdscript\gdscript_analyzer.cpp:1346)
GDScriptAnalyzer::resolve_interface() Line 6307 (modules\gdscript\gdscript_analyzer.cpp:6307)
GDScriptAnalyzer::analyze() Line 6341 (modules\gdscript\gdscript_analyzer.cpp:6341)
GDScript::reload(bool p_keep_state) Line 835 (modules\gdscript\gdscript.cpp:835)
GDScriptCache::get_full_script(const String & p_path, Error & r_error, const String & p_owner, bool p_update_from_disk) Line 385 (modules\gdscript\gdscript_cache.cpp:385)
ResourceFormatLoaderGDScript::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 3018 (modules\gdscript\gdscript.cpp:3018)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1908 (core\variant\variant_parser.cpp:1908)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_thread_function(void * p_user) Line 207 (core\object\worker_thread_pool.cpp:207)
Thread::callback(unsigned __int64 p_caller_id, const Thread::Settings & p_settings, void(*)(void *) p_callback, void * p_userdata) Line 66 (core\os\thread.cpp:66)
```
</details>
<details><summary>Thread</summary>

```
MutexLock<MutexImpl<std::recursive_mutex>>::MutexLock<MutexImpl<std::recursive_mutex>>(const MutexImpl<std::recursive_mutex> & p_mutex) Line 78 (core\os\mutex.h:78)
RendererSceneRenderImplementation::SceneShaderForwardClustered::_create_shader_func() Line 470 (servers\rendering\renderer_rd\forward_clustered\scene_shader_forward_clustered.cpp:470)
RendererSceneRenderImplementation::SceneShaderForwardClustered::_create_shader_funcs() Line 297 (servers\rendering\renderer_rd\forward_clustered\scene_shader_forward_clustered.h:297)
RendererRD::MaterialStorage::shader_set_code(RID p_shader, const String & p_code) Line 1990 (servers\rendering\renderer_rd\storage_rd\material_storage.cpp:1990)
RenderingServerDefault::shader_create_from_code(const String & p_code, const String & p_path_hint) Line 257 (servers\rendering\rendering_server_default.h:257)
BaseMaterial3D::_update_shader() Line 1933 (scene\resources\material.cpp:1933)
BaseMaterial3D::get_rid() Line 2941 (scene\resources\material.cpp:2941)
ArrayMesh::_set_surfaces(const Array & p_surfaces) Line 1633 (scene\resources\mesh.cpp:1633)
call_with_variant_args_helper<ArrayMesh,Array const &,0>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<0> __formal) Line 315 (core\variant\binder_common.h:315)
call_with_variant_args_dv<ArrayMesh,Array const &>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector<Variant> & default_values) Line 463 (core\variant\binder_common.h:463)
MethodBindT<ArrayMesh,Array const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 347 (core\object\method_bind.h:347)
ClassDB::set_property(Object * p_object, const StringName & p_property, const Variant & p_value, bool * r_valid) Line 1633 (core\object\class_db.cpp:1633)
Object::set(const StringName & p_name, const Variant & p_value, bool * r_valid) Line 284 (core\object\object.cpp:284)
ResourceLoaderBinary::load() Line 874 (core\io\resource_format_binary.cpp:874)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
PipelineHashMapRD<RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::PipelineKey,RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData,void (__cdecl RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::*)(RendererSceneRenderImplementation::SceneShaderForwardClustered::ShaderData::PipelineKey)>::wait_for_pipeline(unsigned int p_key_hash) Line 151 (servers\rendering\renderer_rd\pipeline_hash_map_rd.h:151)
RendererSceneRenderImplementation::RenderForwardClustered::mesh_generate_pipelines(RID p_mesh, bool p_background_compilation) Line 4799 (servers\rendering\renderer_rd\forward_clustered\render_forward_clustered.cpp:4799)
RendererSceneCull::mesh_generate_pipelines(RID p_mesh, bool p_background_compilation) Line 1654 (servers\rendering\renderer_scene_cull.cpp:1654)
RenderingServerDefault::mesh_create_from_surfaces(const Vector<RenderingServer::SurfaceData> & p_surfaces, int p_blend_shape_count) Line 336 (servers\rendering\rendering_server_default.h:336)
ArrayMesh::_set_surfaces(const Array & p_surfaces) Line 1674 (scene\resources\mesh.cpp:1674)
call_with_variant_args_helper<ArrayMesh,Array const &,0>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<0> __formal) Line 315 (core\variant\binder_common.h:315)
call_with_variant_args_dv<ArrayMesh,Array const &>(ArrayMesh * p_instance, void(ArrayMesh::*)(const Array &) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector<Variant> & default_values) Line 463 (core\variant\binder_common.h:463)
MethodBindT<ArrayMesh,Array const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 347 (core\object\method_bind.h:347)
ClassDB::set_property(Object * p_object, const StringName & p_property, const Variant & p_value, bool * r_valid) Line 1633 (core\object\class_db.cpp:1633)
Object::set(const StringName & p_name, const Variant & p_value, bool * r_valid) Line 284 (core\object\object.cpp:284)
ResourceLoaderBinary::load() Line 874 (core\io\resource_format_binary.cpp:874)
ResourceFormatLoaderBinary::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1251 (core\io\resource_format_binary.cpp:1251)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceFormatImporter::load_internal(const String & p_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode, bool p_silence_errors) Line 177 (core\io\resource_importer.cpp:177)
ResourceFormatImporter::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 152 (core\io\resource_importer.cpp:152)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
ResourceLoader::_load_start(const String & p_path, const String & p_type_hint, ResourceLoader::LoadThreadMode p_thread_mode, ResourceFormatLoader::CacheMode p_cache_mode, bool p_for_user) Line 655 (core\io\resource_loader.cpp:655)
ResourceLoaderText::load() Line 466 (scene\resources\resource_format_text.cpp:466)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::_parse_tag(VariantParser::Token & token, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1818 (core\variant\variant_parser.cpp:1818)
VariantParser::parse_tag(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1842 (core\variant\variant_parser.cpp:1842)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1882 (core\variant\variant_parser.cpp:1882)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::_parse_tag(VariantParser::Token & token, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1818 (core\variant\variant_parser.cpp:1818)
VariantParser::parse_tag(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1842 (core\variant\variant_parser.cpp:1842)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1882 (core\variant\variant_parser.cpp:1882)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoader::load(const String & p_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error) Line 556 (core\io\resource_loader.cpp:556)
GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode * p_preload) Line 4691 (modules\gdscript\gdscript_analyzer.cpp:4691)
GDScriptAnalyzer::reduce_expression(GDScriptParser::ExpressionNode * p_expression, bool p_is_root) Line 2597 (modules\gdscript\gdscript_analyzer.cpp:2597)
GDScriptAnalyzer::resolve_assignable(GDScriptParser::AssignableNode * p_assignable, const char * p_kind) Line 1989 (modules\gdscript\gdscript_analyzer.cpp:1989)
GDScriptAnalyzer::resolve_constant(GDScriptParser::ConstantNode * p_constant, bool p_is_local) Line 2123 (modules\gdscript\gdscript_analyzer.cpp:2123)
GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode * p_class, int p_index, const GDScriptParser::Node * p_source) Line 1113 (modules\gdscript\gdscript_analyzer.cpp:1113)
GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode * p_class, const GDScriptParser::Node * p_source) Line 1319 (modules\gdscript\gdscript_analyzer.cpp:1319)
GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode * p_class, bool p_recursive) Line 1346 (modules\gdscript\gdscript_analyzer.cpp:1346)
GDScriptAnalyzer::resolve_interface() Line 6307 (modules\gdscript\gdscript_analyzer.cpp:6307)
GDScriptAnalyzer::analyze() Line 6341 (modules\gdscript\gdscript_analyzer.cpp:6341)
GDScript::reload(bool p_keep_state) Line 835 (modules\gdscript\gdscript.cpp:835)
GDScriptCache::get_full_script(const String & p_path, Error & r_error, const String & p_owner, bool p_update_from_disk) Line 385 (modules\gdscript\gdscript_cache.cpp:385)
ResourceFormatLoaderGDScript::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 3018 (modules\gdscript\gdscript.cpp:3018)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_wait_collaboratively(WorkerThreadPool::ThreadData * p_caller_pool_thread, WorkerThreadPool::Task * p_task) Line 524 (core\object\worker_thread_pool.cpp:524)
WorkerThreadPool::wait_for_task_completion(__int64 p_task_id) Line 408 (core\object\worker_thread_pool.cpp:408)
ResourceLoader::_load_complete_inner(ResourceLoader::LoadToken & p_load_token, Error * r_error, MutexLock<SafeBinaryMutex<1>> & p_thread_load_lock) Line 812 (core\io\resource_loader.cpp:812)
ResourceLoader::_load_complete(ResourceLoader::LoadToken & p_load_token, Error * r_error) Line 772 (core\io\resource_loader.cpp:772)
ResourceLoaderText::_parse_ext_resource(VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 147 (scene\resources\resource_format_text.cpp:147)
ResourceLoaderText::_parse_ext_resources(void * p_self, VariantParser::Stream * p_stream, Ref<Resource> & r_res, int & line, String & r_err_str) Line 96 (scene\resources\resource_format_text.h:96)
VariantParser::parse_value(VariantParser::Token & token, Variant & value, VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::ResourceParser * p_res_parser) Line 1104 (core\variant\variant_parser.cpp:1104)
VariantParser::parse_tag_assign_eof(VariantParser::Stream * p_stream, int & line, String & r_err_str, VariantParser::Tag & r_tag, String & r_assign, Variant & r_value, VariantParser::ResourceParser * p_res_parser, bool p_simple_tag) Line 1908 (core\variant\variant_parser.cpp:1908)
ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser & parser) Line 276 (scene\resources\resource_format_text.cpp:276)
ResourceLoaderText::load() Line 825 (scene\resources\resource_format_text.cpp:825)
ResourceFormatLoaderText::load(const String & p_path, const String & p_original_path, Error * r_error, bool p_use_sub_threads, float * r_progress, ResourceFormatLoader::CacheMode p_cache_mode) Line 1413 (scene\resources\resource_format_text.cpp:1413)
ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, ResourceFormatLoader::CacheMode p_cache_mode, Error * r_error, bool p_use_sub_threads, float * r_progress) Line 307 (core\io\resource_loader.cpp:307)
ResourceLoader::_run_load_task(void * p_userdata) Line 389 (core\io\resource_loader.cpp:389)
WorkerThreadPool::_process_task(WorkerThreadPool::Task * p_task) Line 137 (core\object\worker_thread_pool.cpp:137)
WorkerThreadPool::_thread_function(void * p_user) Line 207 (core\object\worker_thread_pool.cpp:207)
Thread::callback(unsigned __int64 p_caller_id, const Thread::Settings & p_settings, void(*)(void *) p_callback, void * p_userdata) Line 66 (core\os\thread.cpp:66)
```
</details>
Nice stacktrace! We can clearly see here the presence of a deadlock.

1. We have WorkerThreadPool tasks calling `SceneShaderForwardClustered::_create_shader_func()` which waits on `singleton_lock.
2. Then in the another WorkerThreadPool task, there is the `SceneShaderForwardClustered::ShaderData::is_valid()` function which holds a `singleton_lock` for the entirety of `ShaderRD::version_is_valid(version)`.
3. `version_is_valid()` calls `_compile_ensure_finished` which calls `_compile_version_end`, which waits for task group completion **while still holding `singleton_lock`**, on the very tasks that are waiting for `singleton_lock`. This is a deadlock.

So what can we fix here? We need to somehow ensure that the `singleton_lock` is not being held at the time that `wait_for_group_task_completion` is invoked, while also ensuring that you don't get multiple threads trampling all over the state of `ShaderRD`. It doesn't look simple to fix, but this issue seems quite severe.

I'm adding the crash label since a deadlock is effectively a crash and I can't find a better label for deadlock.

Edit: One workaround could be to force shader compilation onto a single-threaded WorkerThreadPool, so that it will still get the task dependency calculations but without any risk of deadlock (though I wonder if you'd be hitting lock reentrancy and if there could still be state corruption caused by reentrant locking, given that the code did not seem to consider this).
Thanks @huwpascoe 

There is a mechanism in `WorkerThreadPool` intended to unlock mutexes held by callers while waiting: see `WorkerThreadPool::thread_enter_unlock_allowance_zone()`

Currently, it's not used with `singleton_lock`.

It might be a potential solution worth exploring.
Based on @stuartcarnie great analysis of the deadlock here: https://github.com/godotengine/godot/issues/102812 this happens to be a very common problem with thread pool deadlocks.   

There are no great general purpose solutions to this problem, but here are some of the band-aids that are used in Java and .NET to solve this very common problem:

1. Have a "growing" thread pool that adds threads with some cadence (like spawn a new thread for the thread pool every second or so if you are under duress).   But you also need to implement pool shrinkage.
2. Use separate thread pool for these tasks - use a dedicated thread pool for say the shader compilers, independent of the pool used for other tasks.

None trivial or pleasant to write - and worst of all, they are just band-aids for the underlying design problem.   So I would not even try to attempt those.

But I think there is an even better option for Godot, which would be: set an upper limit to how many threads can be used for shader compilation at once - manually enforcing that there is room left on the thread pool to ensure forward progress.

The idea would be to modify `ShaderRD::_compile_version_start` to check how many tasks it has enqueued on the WorkerThreadPool and anything about a certain threshold, would get added to a queue, rather than immediately placed on the WorkerThreadPool - and the `_compile_version_end` would need to drain that queue as it makes progress.
> Use separate thread pool for these tasks - use a dedicated thread pool for say the shader compilers, independent of the pool used for other tasks.

Quickly tried this (pretty easy to do with current `WorkerThreadPool` implementation), it's fixing running out of stack crashes and decrease frequency of deadlocks a lot, but not completely eliminating them.
> Quickly tried this (pretty easy to do with current WorkerThreadPool implementation), it's fixing running out of stack crashes and decrease frequency of deadlocks a lot, but not completely eliminating them.

Yeah, this approach sadly mostly kicks the can down the road.   The long-term solution in Java was the introduction of virtual threads (effectively, infinite and cheap threads).  A peer of problems also appeared on the Apple platform, with `libdispatch`, so Apple's solution was a pretty strict rule in Swift: tasks should always make forward progress, to the point where using locks in tasks is not possible in the language.

So I think that the best approach is to place a queuing system in front of the WorkerThreadPool, which is both cheaper than the heavy duty real Java/Swift solutions, is not a workaround and has the advantage of being correct (within the confines of still needing a heuristic for "How many threads should we allocate"?)

> The idea would be to modify ShaderRD::_compile_version_start to check how many tasks it has enqueued on the WorkerThreadPool and anything about a certain threshold, would get added to a queue, rather than immediately placed on the WorkerThreadPool - and the _compile_version_end would need to drain that queue as it makes progress.

Won't be that simple. In most deadlock cases, by the time a shader is submitted for compilation, all pool threads are already in the locked state waiting for other `RendererSceneRenderImplementation` related tasks.

> it's fixing running out of stack crashes and decrease frequency of deadlocks a lot, but not completely eliminating them.

Actually, it seems like I have messed up the implementation and left global states shared by both pools. Will recheck it later.
I did this and now I don't experience any deadlock anymore (note that in my case the progress bar was freezing at 75% like @huwpascoe) : https://github.com/godotengine/godot/pull/103509

I don't pretend I fixed it yet 😅 but hope it's a step in the right direction.
Tests and feedback welcome.
> Upgrading to Godot 4.4-rc3 does not fix the issue with my project. The TPS demo also freezes when clicking play and getting to 75%.

For me, my issue with my project was resolved by removing `3d/run_on_separate_thread=true` which I had enabled alongside Jolt. I wonder if the issue with the TPS-demo is caused by [`import/use_multiple_threads=false`](https://github.com/godotengine/tps-demo/blob/117eca00206e78a6291dec5092e44a8f563b35cd/project.godot#L33C1-L33C34).
I already tried the two solutions to this problem, so I will summarize the results.

PR #103506 is not a perfect solution, but it does manage to resolve the issue of indefinite blocking.
* The 75% blockage seems to be completely resolved, although it may still block for a second.
* The 100% blockage persists only for a few seconds, as it eventually responds and loads the scene.
* The blockage when executing the scene directly no longer occurs either.

The best part is that the blockages only happen when all shaders/pipelines need to be recompiled; after that, the scene loads immediately.

As for PR #103509, it did not solve anything, as the blockages still present the same issues.
@Flarkk I'll test later today.

By the way, the forward mobile renderer also has the weird "singleton_mutex" pattern. Looks like it's been copy pasted from this one so it might need the same changes applied?
> PR https://github.com/godotengine/godot/pull/103506 is not a perfect solution, but it does manage to resolve the issue of indefinite blocking.
> The 75% blockage seems to be completely resolved, although it may still block for a second.
> The 100% blockage persists only for a few seconds, as it eventually responds and loads the scene.
> The blockage when executing the scene directly no longer occurs either.

Fixing any stutters during the loading was never a goal of this PR, it's only about deadlocks and crashes.
For those experiencing this issue in 4.4 stable, is there a project setting or other sort of workaround that can be used to mitigate or eliminate this problem?
My workaround is to keep launching it until enough is cached to not block and/or a lucky compilation order happens!
I hypothesise if you set the worker thread pool for your project to a large enough number of threads, it won't block
I had the same problem with the 4.4 stable.
> I hypothesise if you set the worker thread pool for your project to a large enough number of threads, it won't block

We ran into this crash in our project where we're running a closed playtest on steam, people that were specifically on windows 10 were getting freezes when the main scene was being loaded, we tried setting the thread number from `-1` to `1000` and it did indeed solve the issue!

Which is really weird since -1 is mentioned as `unlimited` so it doesn't make sense. @stuartcarnie Do you know whether such a large number of threads could be a problem?

Another really weird thing, once the number was set to a 1000, it worked. Then we set it back to -1, deleted shader_cache and it still worked!
Note there are two shader cache. Editor cache in .godot and main one in %appdata%
> Which is really weird since -1 is mentioned as unlimited so it doesn't make sense. 

`-1` is number of processor cores, not unlimited.
> > Which is really weird since -1 is mentioned as unlimited so it doesn't make sense.
> 
> `-1` is number of processor cores, not unlimited.

Once the fix worked, I assumed so. Before then however, the tooltip made it seem like what I mentioned above:

![Image](https://github.com/user-attachments/assets/be0794cb-12cd-47ac-ada5-4008ad0e3c30)

as you can see, it says "no limit", I might be misunderstanding it though, this isn't exactly an area I know a lot about
> Which is really weird since -1 is mentioned as `unlimited` so it doesn't make sense. [@stuartcarnie](https://github.com/stuartcarnie) Do you know whether such a large number of threads could be a problem?

1000 isn’t ideal, as the `WorkerThreadPool` preallocates 1000 threads. Each thread consumes 1MB of stack space (by default) on Windows, so those 1000 threads will consume a minimum of 1GB of virtual memory. You can probably find a smaller number, like 50 or 20, that’s suitable for now.
IIUC this was likely a duplicate of #102812, which was fixed by #103506 (also cherry-picked into 4.4.1-rc1).
Can anyone affected confirm that the issue is fixed in 4.4.1-rc1 or latest `master`?
@akien-mga I had already mentioned that, in my case, it's resolved.
> IIUC this was likely a duplicate of [#102812](https://github.com/godotengine/godot/issues/102812), which was fixed by [#103506](https://github.com/godotengine/godot/pull/103506) (also cherry-picked into 4.4.1-rc1). Can anyone affected confirm that the issue is fixed in 4.4.1-rc1 or latest `master`?

TLDR: No, not fixed for my project.

At my work this did not fix the issue. It's hard to reproduce on a blank project and is only present in our main project which is 50+ GB big. The problem arises during initial import which just gets stuck at some random point with 0 CPU / RAM / Disk load and keeps you waiting for hours with no progress. We've cherry-picked that PR before the rc1 version (as soon as it's become ready), but the import didn't fix.

As far as I know the work-around colleagues have found is to import things with 4.3 and then open the project in 4.4, but this is only applicable during 4.3->4.4 transition and can't be a working solution later.

I will revisit this topic with colleagues and try to either update what I've just said or provide a little bit more context.
@smedelyan did you try my earlier suggested workaround, which is to set the worker thread pool size to a large number. As I mentioned here, there are tradeoffs:

> 1000 isn’t ideal, as the `WorkerThreadPool` preallocates 1000 threads. Each thread consumes 1MB of stack space (by default) on Windows, so those 1000 threads will consume a minimum of 1GB of virtual memory. You can probably find a smaller number, like 50 or 20, that’s suitable for now.

Perhaps this might help you work around the issue.
So here's feedback from my colleague as-is:

> Based on my observations, it is triggered in the following sequence:
>
> 1. EditorFileSystem::reimport_files sends resources for loading, and at some point all WorkerThreadPool threads become occupied with shader compilation tasks.
> 2. These tasks enter a waiting state for RenderingServer::sync from the main thread, which cannot be executed because it itself is hanging, waiting for a message that at least one resource has been loaded in EditorFileSystem::reimport_files.
> did you try my earlier suggested workaround

No, we didn't. Maybe we'll give it a try later as it's taking literally hours to run even a single iteration of full reimport which may not be enough to call this "not reproducible anymore".
This is still happening in our project, which is smaller than 50GB, but I am not allowed to share it publicly. We have recently updated to 4.4.1 and while everything works fine on Windows (repro rate is about 1 in 10 full reimports), the issue on macOS is so severe, that it is basically unusable (>99% reimports get stuck in a deadlock).

I have tried setting the mentioned `max_threads` setting to 1000, which did not change anything, but it looks like it has been ignored by the editor, because contrary to the behavior described above, Activity Monitor still shows the Godot app as having only 20-25 threads running.

Curiously, `editor/import/use_multiple_threads=false` seems to have fixed the issue (at least on one machine) and it had no effect on the amount of threads observed in Activity monitor.
> I have tried setting the mentioned `max_threads` setting to 1000, which did not change anything, but it looks like it has been ignored by the editor, because contrary to the behavior described above, Activity Monitor still shows the Godot app as having only 20-25 threads running.

Confirmed – sorry for misleading you! Turns out when loading the editor, it does not use the `max_threads` setting:

https://github.com/godotengine/godot/blob/27b2ba667ca98c6dfe125e1df5aeed41d459efa1/main/main.cpp#L1916-L1922
@Darkyenus could you start activity monitor and capture a sample of Godot when it is hanging:

1. Select the Godot process
2. Click Sample Process
3. Drop the text output here

![Image](https://github.com/user-attachments/assets/f12bfbdb-8b82-4348-bc6b-71cad894c358)
I started to investigate this, but I can't reproduce the issue anymore so I can't confirm that my changes help. 

https://github.com/clayjohn/godot/tree/shader-compile-deadlock

This adds a mutex into ShaderRD and removes a bunch of more global mutex locks from other places. The idea was that it would reduce the situation where a thread would hold on to an important lock while waiting for shaders to compile. However, in testing it seems like the most likely scenario is for the Mutex to be locked while attempting to access some other ShaderRD property. Therefore, this change likely only reduces the frequency of this lock rather than fixing it. 

Unfortunately, I can no longer reproduce the deadlock. I thought I fixed it completely, but then when I tested on master to confirm, I could no longer reproduce the deadlock there either. 

Fix patch:
diff --git a/core/object/worker_thread_pool.cpp b/core/object/worker_thread_pool.cpp
index 84ef71c815a4..2e0a01f16530 100644
--- a/core/object/worker_thread_pool.cpp
+++ b/core/object/worker_thread_pool.cpp
@@ -182,6 +182,7 @@ void WorkerThreadPool::_process_task(Task *p_task) {
 
 void WorkerThreadPool::_thread_function(void *p_user) {
 	ThreadData *thread_data = (ThreadData *)p_user;
+	Thread::set_name(vformat("WorkerThread %d", thread_data->index));
 
 	while (true) {
 		Task *task_to_process = nullptr;
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index d1945cfc15ef..3cfb4a455206 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -684,29 +684,38 @@ void BaseMaterial3D::_update_shader() {
 		return; //no update required in the end
 	}
 
-	MutexLock lock(shader_map_mutex);
-	if (shader_map.has(current_key)) {
-		shader_map[current_key].users--;
-		if (shader_map[current_key].users == 0) {
-			// Deallocate shader which is no longer in use.
-			RS::get_singleton()->free(shader_map[current_key].shader);
-			shader_map.erase(current_key);
+	{
+		MutexLock lock(shader_map_mutex);
+		ShaderData *v = shader_map.getptr(current_key);
+		if (v) {
+			v->users--;
+			if (v->users == 0) {
+				// Deallocate shader which is no longer in use.
+				shader_rid = RID();
+				RS::get_singleton()->free(v->shader);
+				shader_map.erase(current_key);
+			}
 		}
-	}
 
-	current_key = mk;
+		current_key = mk;
 
-	if (shader_map.has(mk)) {
-		shader_rid = shader_map[mk].shader;
-		shader_map[mk].users++;
+		v = shader_map.getptr(mk);
+		if (v) {
+			shader_rid = v->shader;
+			v->users++;
 
-		if (_get_material().is_valid()) {
-			RS::get_singleton()->material_set_shader(_get_material(), shader_rid);
-		}
+			if (_get_material().is_valid()) {
+				RS::get_singleton()->material_set_shader(_get_material(), shader_rid);
+			}
 
-		return;
+			return;
+		}
 	}
 
+	// From this point, it is possible that multiple threads requesting the same key will
+	// race to create the shader. The winner, which is the one found in shader_map, will be
+	// used. The losers will free their shader.
+
 	String texfilter_str;
 	// Force linear filtering for the heightmap texture, as the heightmap effect
 	// looks broken with nearest-neighbor filtering (with and without Deep Parallax).
@@ -1929,11 +1938,28 @@ void fragment() {)";
 
 	code += "}\n";
 
-	ShaderData shader_data;
-	shader_data.shader = RS::get_singleton()->shader_create_from_code(code);
-	shader_data.users = 1;
-	shader_map[mk] = shader_data;
-	shader_rid = shader_data.shader;
+	// We must create the shader outside the shader_map_mutex to avoid potential deadlocks with
+	// other tasks in the WorkerThreadPool simultaneously creating materials, which
+	// may also hold the shared shader_map_mutex lock.
+	RID new_shader = RS::get_singleton()->shader_create_from_code(code);
+
+	MutexLock lock(shader_map_mutex);
+
+	ShaderData *v = shader_map.getptr(mk);
+	if (unlikely(v)) {
+		// We raced and managed to create the same key concurrently, so we'll free the shader we just created,
+		// given we know it isn't used, and use the winner.
+		RS::get_singleton()->free(new_shader);
+	} else {
+		ShaderData shader_data;
+		shader_data.shader = new_shader;
+		// ShaderData will be inserted with a users count of 0, but we
+		// increment unconditionally outside this if block, whilst still under lock.
+		v = &shader_map.insert(mk, shader_data)->value;
+	}
+
+	shader_rid = v->shader;
+	v->users++;
 
 	if (_get_material().is_valid()) {
 		RS::get_singleton()->material_set_shader(_get_material(), shader_rid);
@@ -1959,11 +1985,18 @@ void BaseMaterial3D::_check_material_rid() {
 }
 
 void BaseMaterial3D::flush_changes() {
-	MutexLock lock(material_mutex);
+	SelfList<BaseMaterial3D>::List copy;
+	{
+		MutexLock lock(material_mutex);
+		while (SelfList<BaseMaterial3D> *E = dirty_materials.first()) {
+			dirty_materials.remove(E);
+			copy.add(E);
+		}
+	}
 
-	while (dirty_materials.first()) {
-		dirty_materials.first()->self()->_update_shader();
-		dirty_materials.first()->remove_from_list();
+	while (SelfList<BaseMaterial3D> *E = copy.first()) {
+		E->self()->_update_shader();
+		copy.remove(E);
 	}
 }
 
diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp
index 5debecb134d4..b7b14ce6b860 100644
--- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp
+++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp
@@ -141,8 +141,11 @@ void SceneShaderForwardClustered::ShaderData::set_code(const String &p_code) {
 
 	actions.uniforms = &uniforms;
 
-	MutexLock lock(SceneShaderForwardClustered::singleton_mutex);
-	Error err = SceneShaderForwardClustered::singleton->compiler.compile(RS::SHADER_SPATIAL, code, &actions, path, gen_code);
+	Error err = OK;
+	{
+		MutexLock lock(SceneShaderForwardClustered::singleton_mutex);
+		err = SceneShaderForwardClustered::singleton->compiler.compile(RS::SHADER_SPATIAL, code, &actions, path, gen_code);
+	}
 
 	if (err != OK) {
 		if (version.is_valid()) {
@@ -215,7 +218,6 @@ bool SceneShaderForwardClustered::ShaderData::casts_shadows() const {
 
 RS::ShaderNativeSourceCode SceneShaderForwardClustered::ShaderData::get_native_source_code() const {
 	if (version.is_valid()) {
-		MutexLock lock(SceneShaderForwardClustered::singleton_mutex);
 		return SceneShaderForwardClustered::singleton->shader.version_get_native_source_code(version);
 	} else {
 		return RS::ShaderNativeSourceCode();
@@ -406,7 +408,6 @@ RD::PolygonCullMode SceneShaderForwardClustered::ShaderData::get_cull_mode_from_
 
 RID SceneShaderForwardClustered::ShaderData::_get_shader_variant(uint16_t p_shader_version) const {
 	if (version.is_valid()) {
-		MutexLock lock(SceneShaderForwardClustered::singleton_mutex);
 		ERR_FAIL_NULL_V(SceneShaderForwardClustered::singleton, RID());
 		return SceneShaderForwardClustered::singleton->shader.version_get_shader(version, p_shader_version);
 	} else {
@@ -441,7 +442,6 @@ uint64_t SceneShaderForwardClustered::ShaderData::get_vertex_input_mask(Pipeline
 
 bool SceneShaderForwardClustered::ShaderData::is_valid() const {
 	if (version.is_valid()) {
-		MutexLock lock(SceneShaderForwardClustered::singleton_mutex);
 		ERR_FAIL_NULL_V(SceneShaderForwardClustered::singleton, false);
 		return SceneShaderForwardClustered::singleton->shader.version_is_valid(version);
 	} else {
@@ -459,7 +459,6 @@ SceneShaderForwardClustered::ShaderData::~ShaderData() {
 	pipeline_hash_map.clear_pipelines();
 
 	if (version.is_valid()) {
-		MutexLock lock(SceneShaderForwardClustered::singleton_mutex);
 		ERR_FAIL_NULL(SceneShaderForwardClustered::singleton);
 		SceneShaderForwardClustered::singleton->shader.version_free(version);
 	}
@@ -482,8 +481,10 @@ void SceneShaderForwardClustered::MaterialData::set_next_pass(RID p_pass) {
 
 bool SceneShaderForwardClustered::MaterialData::update_parameters(const HashMap<StringName, Variant> &p_parameters, bool p_uniform_dirty, bool p_textures_dirty) {
 	if (shader_data->version.is_valid()) {
+		RID shader_rid = SceneShaderForwardClustered::singleton->shader.version_get_shader(shader_data->version, 0);
+
 		MutexLock lock(SceneShaderForwardClustered::singleton_mutex);
-		return update_parameters_uniform_set(p_parameters, p_uniform_dirty, p_textures_dirty, shader_data->uniforms, shader_data->ubo_offsets.ptr(), shader_data->texture_uniforms, shader_data->default_texture_params, shader_data->ubo_size, uniform_set, SceneShaderForwardClustered::singleton->shader.version_get_shader(shader_data->version, 0), RenderForwardClustered::MATERIAL_UNIFORM_SET, true, true);
+		return update_parameters_uniform_set(p_parameters, p_uniform_dirty, p_textures_dirty, shader_data->uniforms, shader_data->ubo_offsets.ptr(), shader_data->texture_uniforms, shader_data->default_texture_params, shader_data->ubo_size, uniform_set, shader_rid, RenderForwardClustered::MATERIAL_UNIFORM_SET, true, true);
 	} else {
 		return false;
 	}
diff --git a/servers/rendering/renderer_rd/shader_rd.cpp b/servers/rendering/renderer_rd/shader_rd.cpp
index a8a9566f7e40..8910876ffa19 100644
--- a/servers/rendering/renderer_rd/shader_rd.cpp
+++ b/servers/rendering/renderer_rd/shader_rd.cpp
@@ -176,7 +176,11 @@ RID ShaderRD::version_create() {
 	version.initialize_needed = true;
 	version.variants.clear();
 	version.variant_data.clear();
-	return version_owner.make_rid(version);
+	version.mutex = memnew(Mutex);
+	RID rid = version_owner.make_rid(version);
+	MutexLock lock(versions_mutex);
+	version_mutexes.insert(rid, version.mutex);
+	return rid;
 }
 
 void ShaderRD::_initialize_version(Version *p_version) {
@@ -328,7 +332,6 @@ void ShaderRD::_compile_variant(uint32_t p_variant, CompileData p_data) {
 	}
 
 	if (!build_ok) {
-		MutexLock lock(variant_set_mutex); //properly print the errors
 		ERR_PRINT("Error compiling " + String(current_stage == RD::SHADER_STAGE_COMPUTE ? "Compute " : (current_stage == RD::SHADER_STAGE_VERTEX ? "Vertex" : "Fragment")) + " shader, variant #" + itos(variant) + " (" + variant_defines[variant].text.get_data() + ").");
 		ERR_PRINT(error);
 
@@ -343,8 +346,6 @@ void ShaderRD::_compile_variant(uint32_t p_variant, CompileData p_data) {
 	ERR_FAIL_COND(shader_data.is_empty());
 
 	{
-		MutexLock lock(variant_set_mutex);
-
 		p_data.version->variants.write[variant] = RD::get_singleton()->shader_create_from_bytecode_with_samplers(shader_data, p_data.version->variants[variant], immutable_samplers);
 		p_data.version->variant_data.write[variant] = shader_data;
 	}
@@ -355,6 +356,8 @@ RS::ShaderNativeSourceCode ShaderRD::version_get_native_source_code(RID p_versio
 	RS::ShaderNativeSourceCode source_code;
 	ERR_FAIL_NULL_V(version, source_code);
 
+	MutexLock lock(*version->mutex);
+
 	source_code.versions.resize(variant_defines.size());
 
 	for (int i = 0; i < source_code.versions.size(); i++) {
@@ -481,12 +484,10 @@ bool ShaderRD::_load_from_cache(Version *p_version, int p_group) {
 	for (uint32_t i = 0; i < variant_count; i++) {
 		int variant_id = group_to_variant_map[p_group][i];
 		if (!variants_enabled[variant_id]) {
-			MutexLock lock(variant_set_mutex);
 			p_version->variants.write[variant_id] = RID();
 			continue;
 		}
 		{
-			MutexLock lock(variant_set_mutex);
 			RID shader = RD::get_singleton()->shader_create_from_bytecode_with_samplers(p_version->variant_data[variant_id], p_version->variants[variant_id], immutable_samplers);
 			if (shader.is_null()) {
 				for (uint32_t j = 0; j < i; j++) {
@@ -527,7 +528,6 @@ void ShaderRD::_allocate_placeholders(Version *p_version, int p_group) {
 		int variant_id = group_to_variant_map[p_group][i];
 		RID shader = RD::get_singleton()->shader_create_placeholder();
 		{
-			MutexLock lock(variant_set_mutex);
 			p_version->variants.write[variant_id] = shader;
 		}
 	}
@@ -554,7 +554,7 @@ void ShaderRD::_compile_version_start(Version *p_version, int p_group) {
 	compile_data.version = p_version;
 	compile_data.group = p_group;
 
-	WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_named_pool(SNAME("ShaderCompilationPool"))->add_template_group_task(this, &ShaderRD::_compile_variant, compile_data, group_to_variant_map[p_group].size(), -1, true, SNAME("ShaderCompilation"));
+	WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &ShaderRD::_compile_variant, compile_data, group_to_variant_map[p_group].size(), -1, true, SNAME("ShaderCompilation"));
 	p_version->group_compilation_tasks.write[p_group] = group_task;
 }
 
@@ -563,7 +563,7 @@ void ShaderRD::_compile_version_end(Version *p_version, int p_group) {
 		return;
 	}
 	WorkerThreadPool::GroupID group_task = p_version->group_compilation_tasks[p_group];
-	WorkerThreadPool::get_named_pool(SNAME("ShaderCompilationPool"))->wait_for_group_task_completion(group_task);
+	WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task);
 	p_version->group_compilation_tasks.write[p_group] = 0;
 
 	bool all_valid = true;
@@ -616,6 +616,8 @@ void ShaderRD::version_set_code(RID p_version, const HashMap<String, String> &p_
 	Version *version = version_owner.get_or_null(p_version);
 	ERR_FAIL_NULL(version);
 
+	MutexLock lock(*version->mutex);
+
 	_compile_ensure_finished(version);
 
 	version->vertex_globals = p_vertex_globals.utf8();
@@ -651,6 +653,8 @@ void ShaderRD::version_set_compute_code(RID p_version, const HashMap<String, Str
 	Version *version = version_owner.get_or_null(p_version);
 	ERR_FAIL_NULL(version);
 
+	MutexLock lock(*version->mutex);
+
 	_compile_ensure_finished(version);
 
 	version->compute_globals = p_compute_globals.utf8();
@@ -684,6 +688,8 @@ bool ShaderRD::version_is_valid(RID p_version) {
 	Version *version = version_owner.get_or_null(p_version);
 	ERR_FAIL_NULL_V(version, false);
 
+	MutexLock lock(*version->mutex);
+
 	if (version->dirty) {
 		_initialize_version(version);
 		for (int i = 0; i < group_enabled.size(); i++) {
@@ -702,9 +708,17 @@ bool ShaderRD::version_is_valid(RID p_version) {
 
 bool ShaderRD::version_free(RID p_version) {
 	if (version_owner.owns(p_version)) {
+		{
+			MutexLock lock(versions_mutex);
+			version_mutexes.erase(p_version);
+		}
+
 		Version *version = version_owner.get_or_null(p_version);
+		version->mutex->lock();
 		_clear_version(version);
 		version_owner.free(p_version);
+		version->mutex->unlock();
+		memdelete(version->mutex);
 	} else {
 		return false;
 	}
@@ -738,7 +752,9 @@ void ShaderRD::enable_group(int p_group) {
 	version_owner.get_owned_list(&all_versions);
 	for (const RID &E : all_versions) {
 		Version *version = version_owner.get_or_null(E);
+		version->mutex->lock();
 		_compile_version_start(version, p_group);
+		version->mutex->unlock();
 	}
 }
 
diff --git a/servers/rendering/renderer_rd/shader_rd.h b/servers/rendering/renderer_rd/shader_rd.h
index e583ad86a7bd..578e953e854d 100644
--- a/servers/rendering/renderer_rd/shader_rd.h
+++ b/servers/rendering/renderer_rd/shader_rd.h
@@ -63,6 +63,7 @@ class ShaderRD {
 	Vector<RD::PipelineImmutableSampler> immutable_samplers;
 
 	struct Version {
+		Mutex *mutex = nullptr;
 		CharString uniforms;
 		CharString vertex_globals;
 		CharString compute_globals;
@@ -79,8 +80,6 @@ class ShaderRD {
 		bool initialize_needed;
 	};
 
-	Mutex variant_set_mutex;
-
 	struct CompileData {
 		Version *version;
 		int group = 0;
@@ -95,7 +94,9 @@ class ShaderRD {
 	void _compile_ensure_finished(Version *p_version);
 	void _allocate_placeholders(Version *p_version, int p_group);
 
-	RID_Owner<Version> version_owner;
+	RID_Owner<Version, true> version_owner;
+	Mutex versions_mutex;
+	HashMap<RID, Mutex *> version_mutexes;
 
 	struct StageTemplate {
 		struct Chunk {
@@ -168,6 +169,8 @@ class ShaderRD {
 		Version *version = version_owner.get_or_null(p_version);
 		ERR_FAIL_NULL_V(version, RID());
 
+		MutexLock lock(*version->mutex);
+
 		if (version->dirty) {
 			_initialize_version(version);
 			for (int i = 0; i < group_enabled.size(); i++) {
diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp
index 1e4d49815416..2268fa523cfb 100644
--- a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp
@@ -2136,9 +2136,19 @@ void MaterialStorage::_material_queue_update(Material *material, bool p_uniform,
 }
 
 void MaterialStorage::_update_queued_materials() {
-	MutexLock lock(material_update_list_mutex);
-	while (material_update_list.first()) {
-		Material *material = material_update_list.first()->self();
+	SelfList<Material>::List copy;
+	{
+		MutexLock lock(material_update_list_mutex);
+		while (SelfList<Material> *E = material_update_list.first()) {
+			DEV_ASSERT(E == &E->self()->update_element);
+			material_update_list.remove(E);
+			copy.add(E);
+		}
+	}
+
+	while (SelfList<Material> *E = copy.first()) {
+		Material *material = E->self();
+		copy.remove(E);
 		bool uniforms_changed = false;
 
 		if (material->data) {
@@ -2147,8 +2157,6 @@ void MaterialStorage::_update_queued_materials() {
 		material->texture_dirty = false;
 		material->uniform_dirty = false;
 
-		material_update_list.remove(&material->update_element);
-
 		if (uniforms_changed) {
 			//some implementations such as 3D renderer cache the material uniform set, so update is required
 			material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL);


Test patch: