Skip to content

Commit

Permalink
Don't prime depth by copy.
Browse files Browse the repository at this point in the history
Some drivers don't like this behavior, instead of priming
depth by copy, always prime it by rendering. We don't
have THAT many depth buffers, and this is likely more
reliable.
  • Loading branch information
AWoloszyn committed Jun 4, 2018
1 parent 6fac734 commit e8819a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gapis/api/vulkan/state_rebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,8 @@ 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)

primeByBufCopy := (img.Info().Usage() & transDstBit) != 0
isDepth := (img.Info().Usage() & VkImageUsageFlags(VkImageUsageFlagBits_VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) != 0
primeByBufCopy := (img.Info().Usage()&transDstBit) != 0 && (!isDepth)
primeByRendering := (!primeByBufCopy) && ((img.Info().Usage() & attBits) != 0)
primeByImageStore := (!primeByBufCopy) && (!primeByRendering) && ((img.Info().Usage() & storageBit) != 0)

Expand Down

0 comments on commit e8819a5

Please sign in to comment.