Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-01-10 17:56:44 +0300
committerSergey Sharybin <sergey@blender.org>2022-01-10 18:53:44 +0300
commit20cb2c72a559786b69a3f45695b072dd0beae99a (patch)
tree827f6c7c97d7e857587e7160378fd00de3a6bb17
parentd9dd8c287f57716a827483973c31bbb2face2816 (diff)
Fix second render failure with Cycles persistent data
The issue was caused by the recent changes in the way how the render result is drawn: the display driver now could hold an OpenGL resources. Those resources are not shared across contexts so whenever OpenGL context is destroyed those resources are to be destroyed as well (and not attempted to be re-used for a next render). Do such destruction and entire driver re-creation since it does simplifies things from API usage point of view without causing measurable slowdown. Steps to reproduce the issue: - Set the render resolution to 2x of Full HD - Enable persistent data - Render (F12) - Render again Observe OpenGL state being corrupted. Easy to see in debug mode where IMM abstraction level reports issues about the buffer size not being the proper size. This was caused by the display driver trying to use VAO from the previous OpenGL context. Differential Revision: https://developer.blender.org/D13789
-rw-r--r--intern/cycles/blender/session.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/blender/session.cpp b/intern/cycles/blender/session.cpp
index b6f72707fe0..c81a0f4edb2 100644
--- a/intern/cycles/blender/session.cpp
+++ b/intern/cycles/blender/session.cpp
@@ -502,10 +502,15 @@ void BlenderSession::render_frame_finish()
path_remove(filename);
}
- /* Clear driver. */
+ /* Clear output driver. */
session->set_output_driver(nullptr);
session->full_buffer_written_cb = function_null;
+ /* The display driver holds OpenGL resources which belong to an OpenGL context held by the render
+ * engine on Blender side. Force destruction of those resources. */
+ display_driver_ = nullptr;
+ session->set_display_driver(nullptr);
+
/* All the files are handled.
* Clear the list so that this session can be re-used by Persistent Data. */
full_buffer_files_.clear();