Remove CPU sync for vulkan video encode

This commit is contained in:
Patrick Nicolas
2024-10-27 11:31:29 +01:00
parent 6f434ec4cd
commit 1e0ba8b3ea
6 changed files with 161 additions and 73 deletions
+6 -1
View File
@@ -223,7 +223,7 @@ void VideoEncoder::SyncNeeded()
sync_needed = true;
}
void VideoEncoder::PresentImage(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_buf)
void VideoEncoder::present_image(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_buf)
{
// Wait for encoder to be done
busy[next_present].wait(true);
@@ -233,6 +233,11 @@ void VideoEncoder::PresentImage(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_
next_present = (next_present + 1) % num_slots;
}
void VideoEncoder::present_image(vk::Image y_cbcr, vk::raii::CommandBuffer & video_cmd_buf, vk::Fence fence)
{
present_image(sync_needed.load(), y_cbcr, video_cmd_buf, fence, next_present);
}
void VideoEncoder::Encode(wivrn_session & cnx,
const to_headset::video_stream_data_shard::view_info_t & view_info,
uint64_t frame_index)