some more things
This commit is contained in:
parent
ecc11a2751
commit
df0e12a783
|
@ -18,8 +18,10 @@
|
||||||
system: let
|
system: let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config = {
|
||||||
config.allowUnsupportedSystem = true;
|
allowUnfree = true;
|
||||||
|
allowUnsupportedSystem = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenv =
|
stdenv =
|
||||||
|
|
32
src/main.cpp
32
src/main.cpp
|
@ -361,18 +361,20 @@ class VulkanApp {
|
||||||
|
|
||||||
for (u32 i = 0; i < mSwapChainImages.size(); i++) {
|
for (u32 i = 0; i < mSwapChainImages.size(); i++) {
|
||||||
vk::ImageViewCreateInfo createInfo {
|
vk::ImageViewCreateInfo createInfo {
|
||||||
.image = mSwapChainImages[i],
|
.image = mSwapChainImages[i],
|
||||||
.viewType = vk::ImageViewType::e2D,
|
.viewType = vk::ImageViewType::e2D,
|
||||||
.format = mSwapChainImageFormat,
|
.format = mSwapChainImageFormat,
|
||||||
|
// clang-format off
|
||||||
.components = { .r = vk::ComponentSwizzle::eIdentity,
|
.components = { .r = vk::ComponentSwizzle::eIdentity,
|
||||||
.g = vk::ComponentSwizzle::eIdentity,
|
.g = vk::ComponentSwizzle::eIdentity,
|
||||||
.b = vk::ComponentSwizzle::eIdentity,
|
.b = vk::ComponentSwizzle::eIdentity,
|
||||||
.a = vk::ComponentSwizzle::eIdentity },
|
.a = vk::ComponentSwizzle::eIdentity },
|
||||||
.subresourceRange = { .aspectMask = vk::ImageAspectFlagBits::eColor,
|
.subresourceRange = { .aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||||
.baseMipLevel = 0,
|
.baseMipLevel = 0,
|
||||||
.levelCount = 1,
|
.levelCount = 1,
|
||||||
.baseArrayLayer = 0,
|
.baseArrayLayer = 0,
|
||||||
.layerCount = 1 },
|
.layerCount = 1 },
|
||||||
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
mSwapChainImageViews[i] = mDevice->createImageViewUnique(createInfo).value;
|
mSwapChainImageViews[i] = mDevice->createImageViewUnique(createInfo).value;
|
||||||
|
@ -707,12 +709,10 @@ class VulkanApp {
|
||||||
u32 width = 0, height = 0;
|
u32 width = 0, height = 0;
|
||||||
std::tie(width, height) = mWindow->getFramebufferSize();
|
std::tie(width, height) = mWindow->getFramebufferSize();
|
||||||
|
|
||||||
vk::Extent2D actualExtent = { width, height };
|
vk::Extent2D actualExtent = {
|
||||||
|
std::clamp(actualExtent.width, capabilities.minImageExtent.width, capabilities.maxImageExtent.width),
|
||||||
actualExtent.width =
|
std::clamp(actualExtent.height, capabilities.minImageExtent.height, capabilities.maxImageExtent.height)
|
||||||
std::clamp(actualExtent.width, capabilities.minImageExtent.width, capabilities.maxImageExtent.width);
|
};
|
||||||
actualExtent.height =
|
|
||||||
std::clamp(actualExtent.height, capabilities.minImageExtent.height, capabilities.maxImageExtent.height);
|
|
||||||
|
|
||||||
return actualExtent;
|
return actualExtent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue