MantisBT - VTK
View Issue Details
0015765VTK(No Category)public2015-10-09 11:542016-08-12 09:55
Luc Habert 
Sankhesh Jhaveri 
normalminorhave not tried
closedmoved 
 
 
TBD
incorrect functionality
0015765: OpenGL2: context clashes
When an actor is removed from a renderer, the renderer calls the actor's ReleaseGraphicsResources which ends up deleting array objects whose opengl handles are context-specific. Therefore, the window should be made current beforehand, otherwise another window's objects will be affected.

AFAIK, the documentation does not require calling MakeCurrent before removing an actor. I think it should either be made explicit, or RemoveViewProp should call MakeCurrent itself. Ideally, the previous current context should be restored upon exiting RemoveViewProp (*).

Another instance of the same problem: calling vtkWin32OpenGLRenderWindow::Finalize will destroy the context. If the ReleaseGraphicsResources haven't been called first, they will when called affect an unintended context.

(*) BTW: MakeCurrent is called from some places deep in the code (eg vtkWindowToImageFilter, vtkTextureObject::ReleaseGraphicsResources). I believe they should restore the previous context, or all hell could break loose in corner cases, like a vtkWindowToImageFilter used as input to a mapper in a different context.
No tags attached.
Issue History
2015-10-09 11:54Luc HabertNew Issue
2015-10-12 14:35Luc HabertNote Added: 0035276
2016-07-06 16:40Sankhesh JhaveriAssigned To => Sankhesh Jhaveri
2016-07-06 16:40Sankhesh JhaveriNote Added: 0036240
2016-07-06 16:40Sankhesh JhaveriStatusbacklog => gerrit review
2016-08-12 09:55Kitware RobotNote Added: 0037421
2016-08-12 09:55Kitware RobotStatusgerrit review => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved

Notes
(0035276)
Luc Habert   
2015-10-12 14:35   
> calling vtkWin32OpenGLRenderWindow::Finalize will destroy the context. If the ReleaseGraphicsResources haven't been called first, they will when called affect an unintended context

My bad, graphics releases are actually released after a make current during this call.
(0036240)
Sankhesh Jhaveri   
2016-07-06 16:40   
The following merge request fixes the issue:

https://gitlab.kitware.com/vtk/vtk/merge_requests/1636 [^]
(0037421)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.