1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[dxvk] Fix up component swizzle for render target views

Vulkan does not support non-identity swizzles for image views that are
used for rendering, but we have to keep the information around in order
to support rendering to swizzled image formats.
This commit is contained in:
Philip Rebohle 2018-09-01 15:51:56 +02:00
parent f74661daa4
commit 7c97e276f2
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -193,6 +193,12 @@ namespace dxvk {
viewInfo.format = m_info.format;
viewInfo.components = m_info.swizzle;
viewInfo.subresourceRange = subresourceRange;
if (m_info.usage == VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
viewInfo.components = {
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY,
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY };
}
if (m_vkd->vkCreateImageView(m_vkd->device(),
&viewInfo, nullptr, &m_views[type]) != VK_SUCCESS) {