File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,5 +90,7 @@ bool NativeEngine::init_app(bool use_vulkan) {
9090
9191 init_app_common (window_size);
9292
93+ pf_queue->wait_idle ();
94+
9395 return true ;
9496}
Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ int main() {
4040 blit->set_texture (dst_texture);
4141 }
4242
43+ // Make sure encoders submitted are all finished before the main loop starts and the ring buffers starts to work.
44+ queue->wait_idle ();
45+
4346 // Main loop.
4447 while (!window->should_close ()) {
4548 window_builder->poll_events ();
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ class Queue {
2121
2222 virtual void begin_frame (uint32_t current_frame_index) {}
2323
24+ virtual void wait_idle () {}
25+
2426protected:
2527 uint32_t current_frame_index_{};
2628};
Original file line number Diff line number Diff line change @@ -55,4 +55,8 @@ void QueueVk::begin_frame(uint32_t current_frame_index) {
5555 encoders_in_flight_[current_frame_index_ % frames_in_flight_].clear ();
5656}
5757
58+ void QueueVk::wait_idle () {
59+ vkQueueWaitIdle (vk_graphics_queue_);
60+ }
61+
5862} // namespace Pathfinder
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ class QueueVk : public Queue {
1414
1515 void begin_frame (uint32_t current_frame_index) override ;
1616
17+ void wait_idle () override ;
18+
1719private:
1820 VkDevice vk_device_{};
1921
You can’t perform that action at this time.
0 commit comments