Vulkan and OpenGL Interoperability: Image Layout Transition Requirements
0 reputation · 05 May 2021, 10:49 UTC
Shared Image Resource Management
Integrating Vulkan with OpenGL via VK_KHR_external_memory and GL_EXT_memory_objects allows a single allocation to be bound to both a Vulkan image and an OpenGL texture. To ensure data consistency, the application must manage synchronization using VK_KHR_external_semaphore to order access between the two APIs.
Layout Transition Uncertainty
While Vulkan requires explicit image layout transitions, the specification does not define a mandatory layout for images consumed by OpenGL. This creates a boundary where the application must transition the Vulkan image to a compatible state before OpenGL can safely sample the texture.
Because driver implementations vary, it is unclear if certain layouts are universally accepted or if specific OpenGL barriers are required following a Vulkan transition to prevent undefined behavior.
- Which Vulkan image layout is most portable for OpenGL texture sampling?
- Does the OpenGL consumer require a
glMemoryBarriercall after a Vulkan external semaphore signal to guarantee visibility of the layout transition?