Skip barrier in no-copy vulkan video encode

This commit is contained in:
Patrick Nicolas
2026-03-31 09:06:27 +02:00
parent 22a819b8c8
commit 23689abaa7
4 changed files with 25 additions and 13 deletions
+7
View File
@@ -118,6 +118,13 @@ public:
video_encoder(uint8_t stream_idx, const encoder_settings & settings, std::unique_ptr<idr_handler>, bool async_send);
virtual ~video_encoder();
// true when present_image will perform a copy
// and requires the image to be in transfer src layout
virtual bool need_copy() const
{
return true;
}
// return value: true if image should be transitioned to queue and layout for vulkan video encode
// semaphore to be signaled by the compositor
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr,
-1
View File
@@ -633,7 +633,6 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Im
.srcStageMask = vk::PipelineStageFlagBits2KHR::eTransfer,
.dstStageMask = vk::PipelineStageFlagBits2KHR::eVideoEncodeKHR,
.dstAccessMask = vk::AccessFlagBits2::eVideoEncodeReadKHR,
.oldLayout = vk::ImageLayout::eTransferSrcOptimal,
.newLayout = vk::ImageLayout::eVideoEncodeSrcKHR,
.srcQueueFamilyIndex = vk.queue_family_index,
.dstQueueFamilyIndex = vk.encode_queue_family_index,
+4
View File
@@ -96,6 +96,10 @@ protected:
virtual vk::ExtensionProperties std_header_version() = 0;
public:
bool need_copy() const override
{
return slot_data[0].tmp_image;
}
std::optional<data> encode(uint8_t slot, uint64_t frame_index) override;
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) override;
void post_submit(uint8_t slot) override;