some more things

This commit is contained in:
Mars 2024-10-06 01:26:41 -04:00
parent ecc11a2751
commit df0e12a783
Signed by untrusted user: pupbrained
GPG key ID: 0FF5B8826803F895
2 changed files with 20 additions and 18 deletions

View file

@ -18,8 +18,10 @@
system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.allowUnsupportedSystem = true;
config = {
allowUnfree = true;
allowUnsupportedSystem = true;
};
};
stdenv =

View file

@ -364,6 +364,7 @@ class VulkanApp {
.image = mSwapChainImages[i],
.viewType = vk::ImageViewType::e2D,
.format = mSwapChainImageFormat,
// clang-format off
.components = { .r = vk::ComponentSwizzle::eIdentity,
.g = vk::ComponentSwizzle::eIdentity,
.b = vk::ComponentSwizzle::eIdentity,
@ -373,6 +374,7 @@ class VulkanApp {
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1 },
// clang-format on
};
mSwapChainImageViews[i] = mDevice->createImageViewUnique(createInfo).value;
@ -707,12 +709,10 @@ class VulkanApp {
u32 width = 0, height = 0;
std::tie(width, height) = mWindow->getFramebufferSize();
vk::Extent2D actualExtent = { width, height };
actualExtent.width =
std::clamp(actualExtent.width, capabilities.minImageExtent.width, capabilities.maxImageExtent.width);
actualExtent.height =
std::clamp(actualExtent.height, capabilities.minImageExtent.height, capabilities.maxImageExtent.height);
vk::Extent2D actualExtent = {
std::clamp(actualExtent.width, capabilities.minImageExtent.width, capabilities.maxImageExtent.width),
std::clamp(actualExtent.height, capabilities.minImageExtent.height, capabilities.maxImageExtent.height)
};
return actualExtent;
}