GPU: Enable GL multithreaded compilation by default
This allows to reduce the waiting time caused by shader compilation on some GPU-driver combo. A new settings in the User Preferences make it possible to override the default amount of worker threads and optionally use subprocesses. We still use only one worker thread in cases where there is no benefit with adding more workers (like AMD pro driver and Intel windows). It doesn't scale as much as subprocesses for material shader compilation but that is for other reasons explained in #139818. Add some heuristic to avoid too much memory usage and / or too many stalls. Also add some heuristic to the default number of subprocess for the platform that shows scalling. Historically, multithreaded compilation was prevented by the need of context per thread inside `DRWShader` module. Also there was no good scaling at that time. But nowadays numbers shows different results with good scaling with reasonable amount of threads on many platforms. Even if we are going for vulkan in the next release most of the legacy hardware will still use OpenGL for a few other releases. So it is relevant to make this easy improvement. See pull request for measurements. Pull Request: https://projects.blender.org/blender/blender/pulls/139821
This commit is contained in:
committed by
Clément Foucault
parent
b58c5f6e77
commit
1c47e31367
@@ -116,7 +116,8 @@ const UserDef U_default = {
|
||||
#else
|
||||
.gpu_backend = GPU_BACKEND_OPENGL,
|
||||
#endif
|
||||
.max_shader_compilation_subprocesses = 0,
|
||||
.gpu_shader_workers = 0,
|
||||
.shader_compilation_method = USER_SHADER_COMPILE_THREAD,
|
||||
|
||||
/** Initialized by: #BKE_studiolight_default. */
|
||||
.light_param = {{0}},
|
||||
|
||||
Reference in New Issue
Block a user