diff --git a/daslib/vulkan_window.das b/daslib/vulkan_window.das index 9102615..d533ffa 100644 --- a/daslib/vulkan_window.das +++ b/daslib/vulkan_window.das @@ -177,7 +177,7 @@ def public recreate_swapchain(var sc : Swapchain; device : Device; phys : VkPhys vkDeviceWaitIdle(boost_value_to_vk(device)) let keep_format = sc.format // preserve the format across resize (the render pass was built for it) delete sc // release the old swapchain before making a new one (the surface is app-owned) - sc <- create_swapchain(device, phys, surface, width, height, keep_format) // nolint:PERF030 - deleted just above + sc <- create_swapchain(device, phys, surface, width, height, keep_format) build_swapchain_framebuffers(device, sc, render_pass) } diff --git a/tutorials/02_mandelbrot/window/show_mandelbrot_blit.das b/tutorials/02_mandelbrot/window/show_mandelbrot_blit.das index bdb08e2..aac01e8 100644 --- a/tutorials/02_mandelbrot/window/show_mandelbrot_blit.das +++ b/tutorials/02_mandelbrot/window/show_mandelbrot_blit.das @@ -95,7 +95,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) let ok = present_frame(device, queue, swap, pool, sync) $(cmd; target; _idx) { @@ -148,7 +148,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/03_sdf/window/show_sdf.das b/tutorials/03_sdf/window/show_sdf.das index 42eae5c..22faab5 100644 --- a/tutorials/03_sdf/window/show_sdf.das +++ b/tutorials/03_sdf/window/show_sdf.das @@ -85,7 +85,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) let ok = present_frame(device, queue, swap, pool, sync) $(cmd; target; _idx) { @@ -133,7 +133,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/04_cube/window/show_cube.das b/tutorials/04_cube/window/show_cube.das index da8a121..c38ce62 100644 --- a/tutorials/04_cube/window/show_cube.das +++ b/tutorials/04_cube/window/show_cube.das @@ -83,7 +83,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) // 20-second lemniscate orbit -- one full pass per 20s of wall clock. @@ -128,7 +128,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/05_instancing/window/show_instancing.das b/tutorials/05_instancing/window/show_instancing.das index 7ce9de3..353a360 100644 --- a/tutorials/05_instancing/window/show_instancing.das +++ b/tutorials/05_instancing/window/show_instancing.das @@ -82,7 +82,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) // 25-second camera orbit -- one full circle per 25s of wall clock. @@ -126,7 +126,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/06_skybox/window/show_skybox.das b/tutorials/06_skybox/window/show_skybox.das index 671a157..1bbc1e0 100644 --- a/tutorials/06_skybox/window/show_skybox.das +++ b/tutorials/06_skybox/window/show_skybox.das @@ -82,7 +82,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) // 30-second camera orbit -- one full circle per 30s of wall clock. @@ -126,7 +126,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/07_particles/window/show_particles.das b/tutorials/07_particles/window/show_particles.das index 59b3066..0aacf9e 100644 --- a/tutorials/07_particles/window/show_particles.das +++ b/tutorials/07_particles/window/show_particles.das @@ -85,7 +85,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) let dt = min(0.05f, t - last_t) // cap dt so a long stall doesn't fling particles @@ -131,7 +131,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/08_shadow/window/show_shadow.das b/tutorials/08_shadow/window/show_shadow.das index 2b83a53..9133347 100644 --- a/tutorials/08_shadow/window/show_shadow.das +++ b/tutorials/08_shadow/window/show_shadow.das @@ -80,7 +80,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) // 24-second camera orbit; sun rotates at its own rate inside update_shadow_uniforms. @@ -124,7 +124,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/09_msaa/window/show_msaa.das b/tutorials/09_msaa/window/show_msaa.das index e34ade3..8040135 100644 --- a/tutorials/09_msaa/window/show_msaa.das +++ b/tutorials/09_msaa/window/show_msaa.das @@ -99,7 +99,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) // 24-second orbit (camera_t in [0, 1)) @@ -153,7 +153,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/10_deferred/window/show_deferred.das b/tutorials/10_deferred/window/show_deferred.das index 2091b01..a2c96ec 100644 --- a/tutorials/10_deferred/window/show_deferred.das +++ b/tutorials/10_deferred/window/show_deferred.das @@ -97,7 +97,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) let raw_cam = t * 0.042f @@ -148,7 +148,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/11_hdr/window/show_hdr.das b/tutorials/11_hdr/window/show_hdr.das index 6c80eb5..aab9d9a 100644 --- a/tutorials/11_hdr/window/show_hdr.das +++ b/tutorials/11_hdr/window/show_hdr.das @@ -94,7 +94,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) require_srgb_swap(swap) // recreation can fall back to a different surface format } let t = float(glfwGetTime()) @@ -141,7 +141,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/12_gpu_driven/window/show_gpu_driven.das b/tutorials/12_gpu_driven/window/show_gpu_driven.das index 00501b7..01c1aa3 100644 --- a/tutorials/12_gpu_driven/window/show_gpu_driven.das +++ b/tutorials/12_gpu_driven/window/show_gpu_driven.das @@ -80,7 +80,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) let wall_x = 5.0f * sin(t * 1.05f) // sweep the wall across the field (~6 s round trip) @@ -121,7 +121,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/14_teapot/window/show_teapot.das b/tutorials/14_teapot/window/show_teapot.das index 8f20307..d11d91a 100644 --- a/tutorials/14_teapot/window/show_teapot.das +++ b/tutorials/14_teapot/window/show_teapot.das @@ -89,7 +89,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let t = float(glfwGetTime()) update_teapot_uniforms(res, device, t, false) @@ -131,7 +131,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device)) diff --git a/tutorials/15_raytracing/window/show_raytracing.das b/tutorials/15_raytracing/window/show_raytracing.das index d036fed..da5fec4 100644 --- a/tutorials/15_raytracing/window/show_raytracing.das +++ b/tutorials/15_raytracing/window/show_raytracing.das @@ -92,7 +92,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (fbw != swap.width || fbh != swap.height) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } let angle = float(glfwGetTime()) * 0.4 let ok = present_frame(device, queue, swap, pool, sync) $(cmd; target; _idx) { @@ -142,7 +142,7 @@ def main { // nolint:STYLE038 - flat viewer lifecycle scaffold if (!ok) { vkDeviceWaitIdle(boost_value_to_vk(device)) delete swap - swap <- create_swapchain(device, phys, surface, fbw, fbh) // nolint:PERF030 - deleted just above + swap <- create_swapchain(device, phys, surface, fbw, fbh) } } vkDeviceWaitIdle(boost_value_to_vk(device))