Skip to content

Commit

Permalink
Fixed issue with in rendering reload of scene
Browse files Browse the repository at this point in the history
  • Loading branch information
tippesi committed Jul 13, 2023
1 parent d38f53a commit b0c23d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
9 changes: 7 additions & 2 deletions src/demo/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ void App::UnloadContent() {

void App::Update(float deltaTime) {

if (sceneReload) {
UnloadScene();
LoadScene();
sceneReload = false;
}

const ImGuiIO& io = ImGui::GetIO();

imguiWrapper.Update(&window, deltaTime);
Expand Down Expand Up @@ -238,8 +244,7 @@ void App::Render(float deltaTime) {
auto newSceneSelection = static_cast<SceneSelection>(currentItem);
if (IsSceneAvailable(newSceneSelection)) {
sceneSelection = newSceneSelection;
UnloadScene();
LoadScene();
sceneReload = true;
}
else {
openSceneNotFoundPopup = true;
Expand Down
1 change: 1 addition & 0 deletions src/demo/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class App : public Atlas::EngineInstance {
float cameraSpeed = 7.0f;

bool loadingComplete = false;
bool sceneReload = false;

ImguiWrapper imguiWrapper;

Expand Down
6 changes: 0 additions & 6 deletions src/engine/graphics/GraphicsDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,18 +506,12 @@ namespace Atlas {
if (!queue) {
queue = FindAndLockQueue(queueType);
}

if (!queue->IsTypeSupported(queueType)) {
queue = FindAndLockQueue(queueType);
}

if (nextSubmission != nullptr && !queue->IsTypeSupported(nextSubmission->cmd->queueType)) {
nextQueue = FindAndLockQueue(nextSubmission->cmd->queueType);
}
else {
nextQueue = queue;
}

if (nextSubmission == nullptr) {
nextQueue = FindAndLockQueue(QueueType::PresentationQueue);
}
Expand Down

0 comments on commit b0c23d7

Please sign in to comment.