From bfbd0ac220e9b22e0254b1b4e46a5e3cad0f4e71 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 13:50:05 +0100 Subject: [PATCH] Restyled added swapchain scaling (#211) * Restyled by astyle * Restyled by clang-format * Restyled by prettier-markdown --------- Co-authored-by: Restyled.io --- Changelog.md | 2 +- examples/custom/cross-app/entry_main.cpp | 4 +--- examples/custom/multimon-single/entry_main.cpp | 4 +++- wisdom/include/wisdom/vulkan/impl/vk_device.cpp | 3 +-- wisdom/include/wisdom/vulkan/vk_swapchain.h | 2 +- wisdom/platform/windows/wisdom/wisdom_windows.cpp | 1 - 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Changelog.md b/Changelog.md index be944c10..f2ffac10 100644 --- a/Changelog.md +++ b/Changelog.md @@ -16,7 +16,7 @@ - Added Raytracing support for DXR and VK_KHR_ray_tracing - Added compute pipeline and compute functions to the device and command list - Added more bindings to the Descriptor storage - + - 0.5.0 API stabilization - Most of the API is now stable and will not change diff --git a/examples/custom/cross-app/entry_main.cpp b/examples/custom/cross-app/entry_main.cpp index 25b318ec..957ba09e 100644 --- a/examples/custom/cross-app/entry_main.cpp +++ b/examples/custom/cross-app/entry_main.cpp @@ -48,7 +48,6 @@ class App window_size = { uint32_t(w), uint32_t(h) }; // Hook resize from HWND - setup.InitDefault(&platform); @@ -86,7 +85,7 @@ class App bool ProcessEvents() { // Window events - //while (true) { + // while (true) { // //auto event = window.PollEvents(); // switch (event) { // case ex::WindowEvent::Resize: { @@ -267,7 +266,6 @@ class App } }; - int main(int argc, char** argv) { try { diff --git a/examples/custom/multimon-single/entry_main.cpp b/examples/custom/multimon-single/entry_main.cpp index cc18a239..9058af9d 100644 --- a/examples/custom/multimon-single/entry_main.cpp +++ b/examples/custom/multimon-single/entry_main.cpp @@ -357,7 +357,9 @@ class App std::span bounds_span{ bounds.get(), size_t(num_displays) }; // Sort bounds by x coordinate - std::sort(bounds_span.begin(), bounds_span.end(), [](const SDL_Rect& a, const SDL_Rect& b) { return a.x < b.x; }); + std::sort(bounds_span.begin(), bounds_span.end(), [](const SDL_Rect& a, const SDL_Rect& b) { + return a.x < b.x; + }); for (size_t i = 0; i < kMonCount; i++) { window[i].emplace("multimon", bounds_span[i].x, bounds_span[i].y, bounds_span[i].w, bounds_span[i].h, SDL_WINDOW_FULLSCREEN); diff --git a/wisdom/include/wisdom/vulkan/impl/vk_device.cpp b/wisdom/include/wisdom/vulkan/impl/vk_device.cpp index 8293413f..1547d489 100644 --- a/wisdom/include/wisdom/vulkan/impl/vk_device.cpp +++ b/wisdom/include/wisdom/vulkan/impl/vk_device.cpp @@ -1083,8 +1083,7 @@ wis::ImplVKDevice::VKCreateSwapChain(wis::Result& result, wis::SharedSurface sur }; // Check if the swapchain supports dynamic scaling - if (ext1.GetFeatures().dynamic_vsync) - { + if (ext1.GetFeatures().dynamic_vsync) { std::swap(swap_info.pNext, scaling_create_info.pNext); internal.scaling = scaling_create_info.scalingBehavior; swap_info.pNext = &scaling_create_info; diff --git a/wisdom/include/wisdom/vulkan/vk_swapchain.h b/wisdom/include/wisdom/vulkan/vk_swapchain.h index 8ce3cccb..164da272 100644 --- a/wisdom/include/wisdom/vulkan/vk_swapchain.h +++ b/wisdom/include/wisdom/vulkan/vk_swapchain.h @@ -28,7 +28,7 @@ struct VKSwapChainCreateInfo { uint64_t present_id = 0; uint32_t back_buffer_count = 0; - VkPresentScalingFlagsEXT scaling{}; + VkPresentScalingFlagsEXT scaling{}; mutable uint32_t present_index = 0; mutable VkPresentModeKHR present_mode = VK_PRESENT_MODE_FIFO_KHR; diff --git a/wisdom/platform/windows/wisdom/wisdom_windows.cpp b/wisdom/platform/windows/wisdom/wisdom_windows.cpp index e1f2efb1..cbc3d627 100644 --- a/wisdom/platform/windows/wisdom/wisdom_windows.cpp +++ b/wisdom/platform/windows/wisdom/wisdom_windows.cpp @@ -189,7 +189,6 @@ wis::platform::VKWindowsExtension::CreateSwapchain(wis::Result& result, const VK return {}; } - wis::SharedSurface surface_handle{ surface, instance, instance_table.vkDestroySurfaceKHR }; return device.VKCreateSwapChain(result, surface_handle, desc, std::get<0>(main_queue)); }