Skip to content

Commit

Permalink
Revert a change that inexplicably caused a large perf regression.
Browse files Browse the repository at this point in the history
Not entirely sure why this was causing a perf regression,
it should be faster if anything, but reverting until we
can investigate further.
  • Loading branch information
AWoloszyn committed Dec 20, 2018
1 parent 0c8c227 commit f95c914
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions gapis/api/vulkan/state_rebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ func (sb *stateBuilder) createBuffer(buffer BufferObjectʳ) {
1, // bufferBindCount
NewVkSparseBufferMemoryBindInfoᶜᵖ(sb.MustAllocReadData( // pBufferBinds
NewVkSparseBufferMemoryBindInfo(sb.ta,
buffer.VulkanHandle(), // buffer
buffer.VulkanHandle(), // buffer
uint32(buffer.SparseMemoryBindings().Len()), // bindCount
NewVkSparseMemoryBindᶜᵖ( // pBinds
sb.MustAllocReadData(bufSparseBindings).Ptr(),
Expand Down Expand Up @@ -1482,7 +1482,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)
primeByPreinitialization := (!primeByBufCopy) && (!primeByRendering) && (!primeByImageStore) && (img.Info().Tiling() == VkImageTiling_VK_IMAGE_TILING_LINEAR) && (img.Info().InitialLayout() == VkImageLayout_VK_IMAGE_LAYOUT_PREINITIALIZED)
Expand Down Expand Up @@ -1648,8 +1649,8 @@ func (sb *stateBuilder) createImage(img ImageObjectʳ, imgPrimer *imagePrimer) {
continue
}
subRng := NewVkImageSubresourceRange(sb.ta,
img.ImageAspect(), // aspectMask
req.ImageMipTailFirstLod(), // baseMipLevel
img.ImageAspect(), // aspectMask
req.ImageMipTailFirstLod(), // baseMipLevel
img.Info().MipLevels()-req.ImageMipTailFirstLod(), // levelCount
0, // baseArrayLayer
img.Info().ArrayLayers(), // layerCount
Expand All @@ -1662,8 +1663,8 @@ func (sb *stateBuilder) createImage(img ImageObjectʳ, imgPrimer *imagePrimer) {
continue
}
subRng := NewVkImageSubresourceRange(sb.ta,
img.ImageAspect(), // aspectMask
req.ImageMipTailFirstLod(), // baseMipLevel
img.ImageAspect(), // aspectMask
req.ImageMipTailFirstLod(), // baseMipLevel
img.Info().MipLevels()-req.ImageMipTailFirstLod(), // levelCount
i, // baseArrayLayer
1, // layerCount
Expand Down

0 comments on commit f95c914

Please sign in to comment.