From 2d16fbd7e235bf2cc96d451469d8d39cae1917c3 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Thu, 8 Sep 2022 23:04:06 +0200 Subject: First render using new texture uploading system --- src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 5e39a09..805a0b4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -319,8 +319,8 @@ int main() { renderer.recreate_swapchain(); main_scene.meta.cam.set_aspect_ratio((float)event.width / (float)event.height); - vkrenderer::destroy_2d_texture(accumulation_texture); - vkrenderer::destroy_2d_texture(output_texture); + delete accumulation_texture; + delete output_texture; accumulation_texture = vkrenderer::create_2d_texture(event.width, event.height, VK_FORMAT_R32G32B32A32_SFLOAT); output_texture = vkrenderer::create_2d_texture(event.width, event.height, VK_FORMAT_R32G32B32A32_SFLOAT); raytracing_pass->set_dispatch_size(event.width / 8 + 1, event.height / 8 + 1, 1); @@ -406,6 +406,8 @@ int main() { raytracing_pass->set_ouput_texture(output_texture); raytracing_pass->set_constant(60, accumulation_texture); + renderer.begin_frame(); + // update_ui(main_scene, delta_time); if (can_render) { @@ -414,6 +416,8 @@ int main() { std::swap(output_texture, accumulation_texture); } + renderer.finish_frame(); + frame_count++; } -- cgit v1.3