crash fix
This commit is contained in:
parent
be9e3ceff2
commit
33312a5d01
1 changed files with 23 additions and 1 deletions
|
|
@ -622,6 +622,17 @@ void Window::Update() {
|
|||
}
|
||||
|
||||
void Window::Render() {
|
||||
#ifdef CRAFTER_GRAPHICS_RENDERER_SOFTWARE
|
||||
// elements.erase(std::remove(elements.begin(), elements.end(), static_cast<Transform*>(nullptr)), elements.end());
|
||||
// std::sort(elements.begin(), elements.end(), [](Transform* a, Transform* b){ return a->anchor.z < b->anchor.z; });
|
||||
renderer.Render();
|
||||
#ifdef CRAFTER_GRAPHICS_WINDOW_WAYLAND
|
||||
wl_surface_attach(surface, buffer, 0, 0);
|
||||
wl_surface_commit(surface);
|
||||
wl_surface_damage(surface, 0, 0, 10000, 100000);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CRAFTER_GRAPHICS_RENDERER_VULKAN
|
||||
// Acquire the next image from the swap chain
|
||||
Device::CheckVkResult(vkAcquireNextImageKHR(Device::device, swapChain, UINT64_MAX, semaphores.presentComplete, (VkFence)nullptr, ¤tBuffer));
|
||||
submitInfo.commandBufferCount = 1;
|
||||
|
|
@ -653,6 +664,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({startTime, startTime-lastFrameBegin});
|
||||
#ifdef CRAFTER_TIMING
|
||||
totalUpdate = std::chrono::nanoseconds(0);
|
||||
updateTimings.clear();
|
||||
for (const std::pair<const EventListener<FrameTime>*, 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,
|
||||
|
|
@ -704,6 +725,7 @@ void Window::Render() {
|
|||
Device::CheckVkResult(result);
|
||||
}
|
||||
Device::CheckVkResult(vkQueueWaitIdle(Device::queue));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CRAFTER_TIMING
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue