Skip barrier in no-copy vulkan video encode
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user