crash fix
This commit is contained in:
parent
fc8abaa38e
commit
c8ab2bf22e
1 changed files with 6 additions and 4 deletions
|
|
@ -590,10 +590,12 @@ void Window::StopUpdate() {
|
|||
updating = false;
|
||||
}
|
||||
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> startTime;
|
||||
|
||||
void Window::Update() {
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
startTime = std::chrono::high_resolution_clock::now();
|
||||
#ifdef CRAFTER_TIMING
|
||||
vblank = duration_cast<std::chrono::milliseconds>(start - frameEnd);
|
||||
vblank = duration_cast<std::chrono::milliseconds>(startTime - frameEnd);
|
||||
#endif
|
||||
|
||||
#ifdef CRAFTER_TIMING
|
||||
|
|
@ -616,7 +618,7 @@ void Window::Update() {
|
|||
frameTimes.erase(frameTimes.begin());
|
||||
}
|
||||
#endif
|
||||
lastFrameBegin = start;
|
||||
lastFrameBegin = startTime;
|
||||
}
|
||||
|
||||
void Window::Render() {
|
||||
|
|
@ -662,7 +664,7 @@ void Window::Render() {
|
|||
|
||||
vkCmdPipelineBarrier(drawCmdBuffers[currentBuffer], VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR, 0, 0, nullptr, 0, nullptr, 1, &image_memory_barrier);
|
||||
|
||||
onUpdate.Invoke({start, start-lastFrameBegin});
|
||||
onUpdate.Invoke({startTime, startTime-lastFrameBegin});
|
||||
#ifdef CRAFTER_TIMING
|
||||
totalUpdate = std::chrono::nanoseconds(0);
|
||||
updateTimings.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue