From 56878792fcc19c40ec8e70b4fc6d1f26e815075f Mon Sep 17 00:00:00 2001 From: Qining Lu Date: Thu, 25 Jan 2018 12:27:01 -0500 Subject: [PATCH] Bug fix for tracking Vulkan layout transition and image aspect --- gapis/api/vulkan/vulkan.api | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gapis/api/vulkan/vulkan.api b/gapis/api/vulkan/vulkan.api index 618f47dfdc..07ae988ebd 100644 --- a/gapis/api/vulkan/vulkan.api +++ b/gapis/api/vulkan/vulkan.api @@ -4402,17 +4402,21 @@ cmd VkResult vkCreateImage( imageAspect := as!VkImageAspectFlags( switch info.format { + // Depth only case VK_FORMAT_D16_UNORM, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_D32_SFLOAT: VK_IMAGE_ASPECT_DEPTH_BIT + // Stencil only case VK_FORMAT_S8_UINT: VK_IMAGE_ASPECT_STENCIL_BIT + // Depth and Stencil case VK_FORMAT_D16_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT_S8_UINT: VK_IMAGE_ASPECT_DEPTH_BIT | - VK_IMAGE_ASPECT_COLOR_BIT + VK_IMAGE_ASPECT_STENCIL_BIT + // Others default: VK_IMAGE_ASPECT_COLOR_BIT }) @@ -8146,6 +8150,9 @@ vkCmdEndRenderPassArgs { } sub void dovkCmdEndRenderPass(ref!vkCmdEndRenderPassArgs unused) { + for _, i, a in lastDrawInfo().RenderPass.AttachmentDescriptions { + lastDrawInfo().Framebuffer.ImageAttachments[i].Image.Info.Layout = a.finalLayout + } lastDrawInfo().InRenderPass = false popRenderPassMarker() switch len(lastDrawInfo().RenderPass.SubpassDescriptions) > 1 {