Skip to content

Commit

Permalink
Fix possible null semaphore
Browse files Browse the repository at this point in the history
  • Loading branch information
bobcao3 committed Apr 26, 2022
1 parent 6286db7 commit 2158f20
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion taichi/ui/backends/vulkan/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,15 @@ void Renderer::draw_frame(Gui *gui) {
gui->draw(cmd_list.get());
cmd_list->end_renderpass();

std::vector<StreamSemaphore> wait_semaphores{app_context_.prog()->flush()};
std::vector<StreamSemaphore> wait_semaphores;

if (app_context_.prog()) {
auto sema = app_context_.prog()->flush();
if (sema) {
wait_semaphores.push_back(sema);
}
}

if (semaphore) {
wait_semaphores.push_back(semaphore);
}
Expand Down

0 comments on commit 2158f20

Please sign in to comment.