Skip to content

Commit

Permalink
Restyled added swapchain scaling (#211)
Browse files Browse the repository at this point in the history
* Restyled by astyle

* Restyled by clang-format

* Restyled by prettier-markdown

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
github-actions[bot] and restyled-commits authored Jan 30, 2025
1 parent 89eadb0 commit bfbd0ac
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions examples/custom/cross-app/entry_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class App
window_size = { uint32_t(w), uint32_t(h) };

// Hook resize from HWND


setup.InitDefault(&platform);

Expand Down Expand Up @@ -86,7 +85,7 @@ class App
bool ProcessEvents()
{
// Window events
//while (true) {
// while (true) {
// //auto event = window.PollEvents();
// switch (event) {
// case ex::WindowEvent::Resize: {
Expand Down Expand Up @@ -267,7 +266,6 @@ class App
}
};


int main(int argc, char** argv)
{
try {
Expand Down
4 changes: 3 additions & 1 deletion examples/custom/multimon-single/entry_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ class App
std::span<SDL_Rect> 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);
Expand Down
3 changes: 1 addition & 2 deletions wisdom/include/wisdom/vulkan/impl/vk_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion wisdom/include/wisdom/vulkan/vk_swapchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion wisdom/platform/windows/wisdom/wisdom_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit bfbd0ac

Please sign in to comment.