Fix #129019: Prevent render engine changes while rendering #129031
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#129031
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ChengduLittleA/blender:fix-129019"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While animation is being rendered and interface not locked, user could
accidentally change render engine setting which won't make any practical
sense, but will result in a crash. This fix will prevent render engine
changes if blender is rendering stuff.
@ChengduLittleA I would add a
BKE_report
to inform the user they can't switch while rendering.@fclem Can you take a look at this?
+1 for the
BKE_report
.@Sergey tagging you to double check the logic.
Looks fine to me but I am not sure if this covers all cases (python updates during render?).
Also adding a comment as to why we early return would be nice.
The question is why crash happens?
The render pipeline is supposed to be decoupled from the original scene after hitting F12. Changes in render settings, or output settings, or passes, or compositor nodes should not be resulting in crash.
Since python goes through RNA so it is also handled.
Honestly I have no idea. In
DRW_system_gpu_render_context_enable()
I will get the assert saying you should useDRW_gpu_context_enable()
instead, but there's another contextre_system_gpu_context
needs to be bound/enabled, andDRW_gpu_context_enable()
does not take that argument (it usessystem_gpu_context
instead). Any good ideas? 🤔I will add a
report
thingy there.Ok looking deeper into this one. The issue is that the main thread is (apparently) destroying the current
RenderEngine
(callingRE_engine_free
thenengine_depsgraph_free
) which has a gpu context associated with it.The issue is that this gpu context should not be used on the main thread since it was created for rendering on a different thread.
So I am not sure what to do in this case. It might be enough to bind the main DRW context if the thread is main as the resources that needs to be deleted are shared. This diff fixes the crash. But I get a black viewport for one frame from time to time which is concerning.
But this pauses some concerns:
BTW I could reproduce with 3.0 so this bug exists from a very long time. So I don't think it should be high prio.
Commited fix as
dafa3fb88f
Pull request closed