Open Bug 2074667 Opened 1 month ago Updated 1 month ago

Vulkan zero-readback presentation should issue a queue family ownership transfer

Categories

(Core :: Graphics: WebGPU, defect, P1)

defect

Tracking

()

People

(Reporter: teoxoy, Unassigned)

References

(Blocks 1 open bug)

Details

The Vulkan spec says:

To make the contents of the underlying memory accessible in the destination instance or API, applications must

  1. Release exclusive ownership from the source instance or API.
  2. Ensure the release operation has completed using semaphores or fences.
  3. Acquire exclusive ownership in the destination instance or API

Binding a resource to a memory object shared between multiple Vulkan instances or other APIs does not change the ownership of the underlying memory. The first entity to access the resource implicitly acquires ownership. An entity can also implicitly take ownership from another entity in the same way without an explicit ownership transfer. However, taking ownership in this way has the effect that the contents of the underlying memory are undefined.

from https://docs.vulkan.org/spec/latest/chapters/resources.html#resources-external-sharing

Resources shared with external APIs or instances using external memory must also explicitly manage ownership transfers between local and external queues (or equivalent constructs in external APIs) regardless of the VkSharingMode specified when creating them.

The special queue family index VK_QUEUE_FAMILY_FOREIGN_EXT represents any queue external to the resource’s current Vulkan instance, regardless of the queue’s underlying physical device or driver version. This includes, for example, queues for fixed-function image processing devices, media codec devices, and display devices, as well as all queues that use the same underlying device group or physical device, and the same driver version as the resource’s VkDevice.

from https://docs.vulkan.org/spec/latest/chapters/synchronization.html#synchronization-queue-transfers

So, we should emit a barrier with dstQueueFamilyIndex set to VK_QUEUE_FAMILY_FOREIGN_EXT and newLayout set to VK_IMAGE_LAYOUT_GENERAL in our zero-readback presentation path.

Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.