Major synchronization rework

unify submit/post_submit encoder entrypoints
encoders must now wait for their command completion
use transfer queues for CPU -> GPU copy
This commit is contained in:
Patrick Nicolas
2026-04-11 16:55:02 +02:00
parent fe414c4450
commit ce83e8fb03
22 changed files with 785 additions and 617 deletions
+11 -2
View File
@@ -28,12 +28,21 @@ namespace wivrn
class video_encoder_raw : public video_encoder
{
std::array<buffer_allocation, num_slots> buffers;
vk_bundle & vk;
vk::raii::CommandPool cmd_pool;
struct in_t
{
vk::raii::Fence fence = nullptr;
vk::raii::CommandBuffer cmd = nullptr;
buffer_allocation buffer;
};
std::array<in_t, num_slots> in;
public:
video_encoder_raw(wivrn::vk_bundle & vk, const encoder_settings & settings, uint8_t stream_idx);
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 present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo info, uint8_t slot, uint64_t frame_index) override;
std::optional<data> encode(uint8_t slot, uint64_t frame_id) override;
};