Set TRANSFER_SRC flag for swapchain images if supported for it's color format
This commit is contained in:
parent
88da84e665
commit
ffd0bbdacc
1 changed files with 7 additions and 0 deletions
|
|
@ -370,6 +370,13 @@ public:
|
||||||
swapchainCI.clipped = VK_TRUE;
|
swapchainCI.clipped = VK_TRUE;
|
||||||
swapchainCI.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
swapchainCI.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
||||||
|
|
||||||
|
// Set additional usage flag for blitting from the swapchain images if supported
|
||||||
|
VkFormatProperties formatProps;
|
||||||
|
vkGetPhysicalDeviceFormatProperties(physicalDevice, colorFormat, &formatProps);
|
||||||
|
if (formatProps.optimalTilingFeatures & VK_FORMAT_FEATURE_BLIT_DST_BIT) {
|
||||||
|
swapchainCI.imageUsage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
|
||||||
|
}
|
||||||
|
|
||||||
err = fpCreateSwapchainKHR(device, &swapchainCI, nullptr, &swapChain);
|
err = fpCreateSwapchainKHR(device, &swapchainCI, nullptr, &swapChain);
|
||||||
assert(!err);
|
assert(!err);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue