diff --git a/implementations/Crafter.Graphics-Window.cpp b/implementations/Crafter.Graphics-Window.cpp index 05eef25..0cbd526 100644 --- a/implementations/Crafter.Graphics-Window.cpp +++ b/implementations/Crafter.Graphics-Window.cpp @@ -596,16 +596,6 @@ void Window::Update() { vblank = duration_cast(start - frameEnd); #endif - onUpdate.Invoke({start, start-lastFrameBegin}); - #ifdef CRAFTER_TIMING - totalUpdate = std::chrono::nanoseconds(0); - updateTimings.clear(); - for (const std::pair*, std::chrono::nanoseconds>& entry : onUpdate.listenerTimes) { - updateTimings.push_back(entry); - totalUpdate += entry.second; - } - #endif - #ifdef CRAFTER_TIMING auto renderStart = std::chrono::high_resolution_clock::now(); renderTimings.clear(); @@ -672,6 +662,16 @@ 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}); + #ifdef CRAFTER_TIMING + totalUpdate = std::chrono::nanoseconds(0); + updateTimings.clear(); + for (const std::pair*, std::chrono::nanoseconds>& entry : onUpdate.listenerTimes) { + updateTimings.push_back(entry); + totalUpdate += entry.second; + } + #endif + vkCmdBindPipeline(drawCmdBuffers[currentBuffer], VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, rtPipeline); VkBindDescriptorSetsInfo bindDescriptorSetsInfo{ .sType = VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO,