Move call to drw_state_ensure_not_reused() inside the region locked by DST.gl_context_mutex.
Currently with a debug build there is a race condition where the mutex is released before the DST structure is reset to 0xFF, meaning when multiple threads are using the DRWManager it can get cleared when the main thread is using it, causing crashes. Reviewers: fclem, brecht Reviewed By: fclem Tags: #bf_blender_2.8 Differential Revision: https://developer.blender.org/D3476
This commit is contained in:
Submodule release/scripts/addons updated: ebd058d7a6...8f2fd7e23f
Submodule release/scripts/addons_contrib updated: 4747021578...34a27a42d7
@@ -1548,6 +1548,11 @@ void DRW_render_to_image(RenderEngine *engine, struct Depsgraph *depsgraph)
|
||||
GPU_viewport_free(DST.viewport);
|
||||
GPU_framebuffer_restore();
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Avoid accidental reuse. */
|
||||
drw_state_ensure_not_reused(&DST);
|
||||
#endif
|
||||
|
||||
/* Changing Context */
|
||||
if (re_gl_context != NULL) {
|
||||
DRW_shape_cache_reset(); /* XXX fix that too. */
|
||||
@@ -1560,11 +1565,6 @@ void DRW_render_to_image(RenderEngine *engine, struct Depsgraph *depsgraph)
|
||||
else {
|
||||
DRW_opengl_context_disable();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Avoid accidental reuse. */
|
||||
drw_state_ensure_not_reused(&DST);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DRW_render_object_iter(
|
||||
|
||||
Submodule source/tools updated: 9d7d338cb2...f35d8e55af
Reference in New Issue
Block a user