Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions atlas/application/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4479,6 +4479,14 @@ void Window::close() { this->shouldClose = true; }

void Window::setCamera(Camera *newCamera) { this->camera = newCamera; }

void Window::waitForRendering() {
#ifdef VULKAN
if (activeCommandBuffer != nullptr) {
activeCommandBuffer->waitForSubmittedWork();
}
#endif
}

void Window::applyScene(Scene *scene) {
atlas_log("Setting active scene");
this->pendingScene = nullptr;
Expand Down
2 changes: 2 additions & 0 deletions include/atlas/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,8 @@ class Window {
*/
std::shared_ptr<opal::Device> getDevice() const { return this->device; }

void waitForRendering();

/**
* @brief Returns the lazily created deferred geometry buffer.
*
Expand Down
2 changes: 1 addition & 1 deletion opal
Submodule opal updated 1 files
+27 −9 src/command_buffer.cpp
1 change: 1 addition & 0 deletions runtime/lib/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7306,6 +7306,7 @@ void Context::loadMainScene(Window &window) {
}

void Context::loadScene(Window &window, const json &sceneData) {
window.waitForRendering();
auto sceneNameIt = sceneData.find("name");
if (sceneNameIt != sceneData.end() && sceneNameIt->is_string()) {
currentSceneName = sceneNameIt->get<std::string>();
Expand Down
Loading