Skip to content

Commit

Permalink
Vulkan: Fix the attachment image layout tracking (#2455)
Browse files Browse the repository at this point in the history
The loadAttachment and storeAttachment subroutine should not be labelled
with @spy_disabled, as we need to track the attachments' layout
  • Loading branch information
Qining authored Dec 13, 2018
1 parent bc7b689 commit de6e30f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions gapis/api/vulkan/api/renderpass_framebuffer.api
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ cmd void vkCmdEndRenderPass(
}
}

@spy_disabled
sub void loadImageAttachment(u32 attachmentID) {
VK_ATTACHMENT_UNUSED := as!u32(0xFFFFFFFF)
if attachmentID != VK_ATTACHMENT_UNUSED {
Expand All @@ -426,7 +425,6 @@ sub void loadImageAttachment(u32 attachmentID) {
}
}

@spy_disabled
sub void storeImageAttachment(u32 attachmentID) {
VK_ATTACHMENT_UNUSED := as!u32(0xFFFFFFFF)
if attachmentID != VK_ATTACHMENT_UNUSED {
Expand Down
3 changes: 1 addition & 2 deletions gapis/api/vulkan/state_rebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,7 @@ func (sb *stateBuilder) createImage(img ImageObjectʳ, imgPrimer *imagePrimer) {
attBits := VkImageUsageFlags(VkImageUsageFlagBits_VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VkImageUsageFlagBits_VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
storageBit := VkImageUsageFlags(VkImageUsageFlagBits_VK_IMAGE_USAGE_STORAGE_BIT)

isDepth := (img.Info().Usage() & VkImageUsageFlags(VkImageUsageFlagBits_VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) != 0
primeByBufCopy := (img.Info().Usage()&transDstBit) != 0 && (!isDepth)
primeByBufCopy := (img.Info().Usage() & transDstBit) != 0
primeByRendering := (!primeByBufCopy) && ((img.Info().Usage() & attBits) != 0)
primeByImageStore := (!primeByBufCopy) && (!primeByRendering) && ((img.Info().Usage() & storageBit) != 0)
primeByPreinitialization := (!primeByBufCopy) && (!primeByRendering) && (!primeByImageStore) && (img.Info().Tiling() == VkImageTiling_VK_IMAGE_TILING_LINEAR) && (img.Info().InitialLayout() == VkImageLayout_VK_IMAGE_LAYOUT_PREINITIALIZED)
Expand Down

0 comments on commit de6e30f

Please sign in to comment.