Vulkan: Share Device Between Contexts #107606

Merged
Jeroen Bakker merged 2 commits from Jeroen-Bakker/blender:vulkan-share-device into main 2023-05-04 10:06:54 +02:00

2 Commits

Author SHA1 Message Date
Jeroen Bakker eb5d6845c3 Remove comment 2023-05-04 10:06:03 +02:00
Jeroen Bakker 1af40437fe Vulkan: Share Device Between Contexts
Previous GHOST_ContextVK would create a logical device for each
context. Blender uses multiple contexts at the same time and wasn't able
to share resources between them as the logical device where different.

This patch will create a single logical device and share them between
multiple contexts. This allows sharing memory/shaders between contexts
and make sure that all memory allocations are freed from the device it
was allocated from.

Some allocations in Blender are freed when there isn't a context, this
was failing in the previous implementation. We didn't noticed it before
as we didn't test multiple contexts.

This patch also moves device specific data structures from VKContext to
VKDevice like the descriptor pools, debug layers etc.
2023-05-04 09:54:30 +02:00