Foreign queue transfers are hard to use correctly
@r-potter đang làm issue này rồi.
Từ ngày 21/10/2026.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- markdown
- Lĩnh vực
- documentation
Hướng nghiên cứu
Start by reading the synchronization and image-layout-transition specification sections linked in the issue, especially the rules for foreign queue transfers. The issue describes two proposed specification changes but does not identify files or tests; first determine where those rules are documented and how changes are validated in Vulkan-Docs. Done means the spec clearly resolves foreign-queue layout transitions and their synchronization requirements.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The foreign queue is designed to work across vulkan drivers and to additionally allow interop between vulkan and non-vulkan APIs.
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.
When a queue transfer barrier also contains an image layout transition, the spec requires that both release and acquire operations use the same values in oldLayout and newLayout. The spec says that the transition will be executed only once, and it is unspecified if the transition is executed by the release operation or the acquire operation:
If the transfer is via an image memory barrier, and an image layout transition is desired, then the values of oldLayout and newLayout in the release operation's memory barrier must be equal to values of oldLayout and newLayout in the acquire operation's memory barrier. Although the image layout transition is submitted twice, it will only be executed once.
However, this is impossible with the foreign queue, for two reasons:
- If the other half is a non-vulkan API, then there are no oldLayout/newLayout parameters.
- Even if the other half is only a different driver version (let alone completely different drivers), the driver versions might disagree which half executes the layout transition.
Therefore, it seems that you cannot combine a queue transfer involving the foreign queue with an image layout transition in a single barrier. The "solution" I have been using is to use two barriers. For the release operation:
- An image layout transition to GENERAL with no queue transfer.
- A queue transfer with oldLayout = newLayout = GENERAL.
And the inverse for the acquire operation.
However, this is more tricky than it might initially appear. You cannot submit both barriers with a single vkCmdPipelineBarrier2. The synchronization scopes of vkCmdPipelineBarrier2 only contain commands submitted previously/afterwards. There is no ordering between barriers within a single vkCmdPipelineBarrier2. Submitting both barriers in a single vkCmdPipelineBarrier2 would therefore effect two unordered memory operations on the image.
You must instead submit barrier 1 in one vkCmdPipelineBarrier2 and then barrier 2 in a separate vkCmdPipelineBarrier2.
Furthermore, you must ensure that both barriers form an execution dependency chain. I'm not sure if there is a way to do this while strictly following the spec, but I've been "doing" it by setting the dstStageMask of barrier 1 and srcStageMask of barrier 2 to the same value.
The reason I believe it cannot be done within the spec is that such a chain requires the intersection of the second synchronization scope of the first barrier and the first synchronization scope of the second barrier to be non-empty. But there are no commands between the two barriers, so the intersection is empty.
This all seems unnecessarily complicated and I wonder if it could be simplified. I see a few possibilities:
- Having a dedicated cmd that can be used to acquire/release foreign memory.
- Specifying that the layout transition is executed by the release side when transitioning to the foreign queue and removing the requirement that both sides agree on the parameters. And the same for the acquire side.
- Ngôn ngữ chính
- JavaScript
- Star
- 3.4k
- Fork
- 555
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của KhronosGroup/Vulkan-Docs
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
KhronosGroup/Vulkan-Docs#2823 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 44/100
KhronosGroup/Vulkan-Docs#2863 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
KhronosGroup/Vulkan-Docs#2861 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
KhronosGroup/Vulkan-Docs#2860 · 1 bình luận ·
-
VUID-vkCmdBindResourceHeapEXT-pBindInfo-12558Có thể đã có người làm @spencer-lunarg đã nhận 2 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
KhronosGroup/Vulkan-Docs#2857 · 4 bình luận · 1 người được giao ·
Tất cả issue của KhronosGroup/Vulkan-Docs
Issue tương tự
-
[ordering-review] workshop order graph: 1 confirmed ordering issue, cycles are false positivesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
githubnext/gh-aw-workshop#6247 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue type/ci
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 81/100
c-w-z/commit-decision-record#20 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: China en Vivo (CN)Đang mởchannels:add check:passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
web-platform-tests/wpt#65844 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
JuliusBrussee/caveman#1606 ·
Maintainer thường phản hồi trong vòng 1 ngày