Use device memory for vulkan encode

This commit is contained in:
Patrick Nicolas
2024-11-10 16:46:28 +01:00
parent 4df0e391c6
commit 6943fa82d2
13 changed files with 181 additions and 45 deletions
+5 -4
View File
@@ -115,8 +115,9 @@ public:
virtual ~video_encoder();
// return value: true if image should be transitioned to queue and layout for vulkan video encode
bool present_image(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_buf, uint64_t frame_index);
void post_submit(vk::Semaphore);
// semaphore to be signaled by the compositor
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_buf, uint64_t frame_index);
void post_submit();
virtual void on_feedback(const from_headset::feedback &);
virtual void reset();
@@ -127,9 +128,9 @@ public:
protected:
// called on present to submit command buffers for the image.
virtual bool present_image(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) = 0;
virtual std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) = 0;
// called after command buffer passed in present_image was submitted
virtual void post_submit(vk::Semaphore, uint8_t slot) {}
virtual void post_submit(uint8_t slot) {}
// called when command buffer finished executing
virtual std::optional<data> encode(bool idr, std::chrono::steady_clock::time_point target_timestamp, uint8_t slot) = 0;