Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Fix the attachment image layout tracking #2455

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDepth was used for debugging depth/stencil image priming by rendering. It does not imply depth stencil images with TRANSFER_DST_BIT set can not be primed by buffer copy.

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