This fixes a crash on old Intel GPUs.
This patch forces the compilation of shaders in only one thread at a time.
So there is no longer the need to create multiple rendering contexts.
Thus having a thread and a rendering context, this can be used for the GPU_pass_cache_garbage_collect and thus fix the Intel crash that involves:
- deleting shaders in the same context in which they were used,
- re-creating a shader with the same program nme in another context and
- reusing in the first context .
Concerns:
- I only know how to use the BLI_rw_mutex_lock and BLI_rw_mutex_unlock functions, I don't know the impact of replacing BLI_spin_lock;
- Is there a better place for DRW_deferred_shader_init and DRW_deferred_shader_end?;