rendervulkan: Fix validation errors for linear swapchain view.

VK_FORMAT_B8G8R8A8_SRGB doesn't support STORAGE usage.
Otherwise we hit asserts in mesa.
This commit is contained in:
Georg Lehmann 2022-11-03 18:57:18 +01:00 committed by Joshie
parent a7f8b26833
commit c1fd2d7f7a

View file

@ -2352,6 +2352,12 @@ bool CVulkanTexture::BInitFromSwapchain( VkImage image, uint32_t width, uint32_t
return false; return false;
} }
VkImageViewUsageCreateInfo viewUsageInfo = {
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO,
.usage = VK_IMAGE_USAGE_SAMPLED_BIT,
};
createInfo.pNext = &viewUsageInfo;
createInfo.format = ToSrgbVulkanFormat( format ); createInfo.format = ToSrgbVulkanFormat( format );
res = g_device.vk.CreateImageView(g_device.device(), &createInfo, nullptr, &m_linearView); res = g_device.vk.CreateImageView(g_device.device(), &createInfo, nullptr, &m_linearView);