Skip to content

Commit

Permalink
Don't ask for TRANSFER_DST for swapchain surface. No reason to.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jun 21, 2019
1 parent b5ad92b commit 0f9dbaa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Common/Vulkan/VulkanContext.cpp
Expand Up @@ -929,7 +929,7 @@ bool VulkanContext::InitSwapchain() {


if (physicalDeviceProperties_[physical_device_].properties.vendorID == VULKAN_VENDOR_IMGTEC) { if (physicalDeviceProperties_[physical_device_].properties.vendorID == VULKAN_VENDOR_IMGTEC) {
// Swap chain width hack to avoid issue #11743 (PowerVR driver bug). // Swap chain width hack to avoid issue #11743 (PowerVR driver bug).
// TODO: Check if still broken if pretransform is used // TODO: Check if still broken if pretransform is used!
swapChainExtent_.width &= ~31; swapChainExtent_.width &= ~31;
} }


Expand Down Expand Up @@ -1021,7 +1021,7 @@ bool VulkanContext::InitSwapchain() {
swap_chain_info.surface = surface_; swap_chain_info.surface = surface_;
swap_chain_info.minImageCount = desiredNumberOfSwapChainImages; swap_chain_info.minImageCount = desiredNumberOfSwapChainImages;
swap_chain_info.imageFormat = swapchainFormat_; swap_chain_info.imageFormat = swapchainFormat_;
swap_chain_info.imageColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; swap_chain_info.imageColorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
swap_chain_info.imageExtent.width = swapChainExtent_.width; swap_chain_info.imageExtent.width = swapChainExtent_.width;
swap_chain_info.imageExtent.height = swapChainExtent_.height; swap_chain_info.imageExtent.height = swapChainExtent_.height;
swap_chain_info.preTransform = preTransform; swap_chain_info.preTransform = preTransform;
Expand All @@ -1030,8 +1030,9 @@ bool VulkanContext::InitSwapchain() {
swap_chain_info.oldSwapchain = VK_NULL_HANDLE; swap_chain_info.oldSwapchain = VK_NULL_HANDLE;
swap_chain_info.clipped = true; swap_chain_info.clipped = true;
swap_chain_info.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; swap_chain_info.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
if (surfCapabilities_.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) // Don't ask for TRANSFER_DST for the swapchain image, we don't use that.
swap_chain_info.imageUsage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT; // if (surfCapabilities_.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT)
// swap_chain_info.imageUsage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT;


#ifndef ANDROID #ifndef ANDROID
// We don't support screenshots on Android // We don't support screenshots on Android
Expand All @@ -1056,7 +1057,7 @@ bool VulkanContext::InitSwapchain() {
ELOG("vkCreateSwapchainKHR failed!"); ELOG("vkCreateSwapchainKHR failed!");
return false; return false;
} }

ILOG("Created swapchain: %dx%d", swap_chain_info.imageExtent.width, swap_chain_info.imageExtent.height);
return true; return true;
} }


Expand Down

0 comments on commit 0f9dbaa

Please sign in to comment.