Fix vulkan encode QFOT layouts (NVIDIA green frame)

Compositor release left layouts as eUndefined while encoder acquire
transitioned to eVideoEncodeSrcKHR (or eTransferSrcOptimal on the NVIDIA
tmp_image path); the spec forbids that layout mismatch for exclusive-mode
QFOT. NVIDIA honoured it by treating encode-queue contents as undefined
(solid green frame).

Encoders now publish target_layout. The compositor's release and the
encoder's acquire both transition eGeneral -> target_layout in a single
barrier; per VkImageMemoryBarrier2 the layout transition is performed
exactly once between the queues, so no second non-QFOT barrier is needed.
target_layout is eVideoEncodeSrcKHR on the direct vulkan encode path and
eGeneral elsewhere.

Also fix optimal_transfer(): the inner `auto to = ...` shadowed the
parameter, so the maintenance9 check was effectively always false.
This commit is contained in:
Jonathan Steffan
2026-05-19 06:59:03 +02:00
committed by Patrick Nicolas
parent f54be85c26
commit e79621d377
4 changed files with 49 additions and 28 deletions
+2 -2
View File
@@ -419,8 +419,8 @@ bool wivrn::vk_bundle::optimal_transfer(uint32_t from, uint32_t to) const
{
auto props = physical_device.getQueueFamilyProperties2<vk::StructureChain<vk::QueueFamilyProperties2, vk::QueueFamilyOwnershipTransferPropertiesKHR>>();
auto to = std::get<1>(props[from]).optimalImageTransferToQueueFamilies;
return to & (1 << to);
auto mask = std::get<1>(props[from]).optimalImageTransferToQueueFamilies;
return (mask & (1u << to)) != 0;
}
#endif
return true;