Use the right aspect for creating texture-display image views

* Even if depth display isn't right, this is at least not as wrong.
This commit is contained in:
baldurk
2016-02-07 18:46:47 +01:00
parent 764296e980
commit 666c3176f8
+8 -1
View File
@@ -958,10 +958,17 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn
Unwrap(liveIm), VK_IMAGE_VIEW_TYPE_2D,
iminfo.format,
{ VK_CHANNEL_SWIZZLE_R, VK_CHANNEL_SWIZZLE_G, VK_CHANNEL_SWIZZLE_B, VK_CHANNEL_SWIZZLE_A },
{ VK_IMAGE_ASPECT_COLOR_BIT, 0, RDCMAX(1U, (uint32_t)iminfo.mipLevels), 0, 1, },
{ layouts.subresourceStates[0].subresourceRange.aspectMask, 0, RDCMAX(1U, (uint32_t)iminfo.mipLevels), 0, 1, },
0
};
if(layouts.subresourceStates[0].subresourceRange.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT)
{
viewInfo.channels.g = VK_CHANNEL_SWIZZLE_ZERO;
viewInfo.channels.b = VK_CHANNEL_SWIZZLE_ZERO;
viewInfo.channels.a = VK_CHANNEL_SWIZZLE_ZERO;
}
// Only needed on AMD - does the wrong thing on nvidia - so commented for now while AMD
// drivers aren't on 0.9.2
//if(iminfo.format == VK_FORMAT_B8G8R8A8_UNORM || iminfo.format == VK_FORMAT_B8G8R8A8_SRGB)