Page MenuHome

Fix GPU backend deleting resources without an active context
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Jul 15 2022, 1:49 PM.

Details

Summary

This causes an assert with libepoxy, but was wrong regardless.

Refactor logic to work as follows:

  • GPU_exit() deletes backend resources
  • GPU context create/discard automatically creates/discards the backend
  • Destroy UI GPU resources with the context active

Ref D15291

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested review of this revision.Jul 15 2022, 1:49 PM
Brecht Van Lommel (brecht) created this revision.
Brecht Van Lommel (brecht) retitled this revision from Fix GPU backend deleting samples without an active context to Fix GPU backend deleting resources without an active context.Jul 15 2022, 1:51 PM
Clément Foucault (fclem) requested changes to this revision.Jul 15 2022, 2:30 PM
Clément Foucault (fclem) added inline comments.
source/blender/gpu/intern/gpu_context.cc
90

this should be guarded by a mutex of some sort. Render threads can create the context themselves AFAIK.

This revision now requires changes to proceed.Jul 15 2022, 2:30 PM
Brecht Van Lommel (brecht) marked an inline comment as done.Jul 15 2022, 2:40 PM
This revision is now accepted and ready to land.Jul 15 2022, 2:50 PM

Rebase on D15463.

Expose GPU_backend_exit in the API again. For symmetry I wanted to hide both init and exit, but if init is going to be exposed then we might as well expose exit again also.

Brecht Van Lommel (brecht) requested review of this revision.Jul 15 2022, 3:57 PM
This revision is now accepted and ready to land.Jul 15 2022, 4:05 PM