diff options
author | Greg Daniel <egdaniel@google.com> | 2018-06-18 11:26:30 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-18 15:54:28 +0000 |
commit | ddc0c6006c44bd31ef0adc9eb06e68b17218198f (patch) | |
tree | c1e5c13e9d0c22e1b78a5c6c39e0a1ca2a11d969 /src/gpu/vk | |
parent | e475d016d9f101b7919100099824af3796a0222a (diff) |
Always use dedicated VkImage memory on NexusPlayer and Mali.
Fixes issues caused by https://skia-review.googlesource.com/c/skia/+/135260
Bug: skia:
Change-Id: I99db232c6ba56f4adccf6cfaa9c29a4bec900d9b
Reviewed-on: https://skia-review.googlesource.com/135448
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'src/gpu/vk')
-rw-r--r-- | src/gpu/vk/GrVkCaps.cpp | 17 | ||||
-rw-r--r-- | src/gpu/vk/GrVkCaps.h | 15 | ||||
-rw-r--r-- | src/gpu/vk/GrVkMemory.cpp | 6 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp index 602e9e14e7..cc9d0ca815 100644 --- a/src/gpu/vk/GrVkCaps.cpp +++ b/src/gpu/vk/GrVkCaps.cpp @@ -22,7 +22,7 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface* fMustSubmitCommandsBeforeCopyOp = false; fMustSleepOnTearDown = false; fNewCBOnPipelineChange = false; - fCanUseWholeSizeOnFlushMappedMemory = true; + fShouldAlwaysUseDedicatedImageMemory = false; /************************************************************************** * GrDrawTargetCaps fields @@ -223,6 +223,12 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface* this->applyDriverCorrectnessWorkarounds(properties); } + // On nexus player we disable suballocating VkImage memory since we've seen large slow downs on + // bot run times. + if (kImagination_VkVendor == properties.vendorID) { + fShouldAlwaysUseDedicatedImageMemory = true; + } + this->applyOptionsOverrides(contextOptions); fShaderCaps->applyOptionsOverrides(contextOptions); } @@ -252,6 +258,11 @@ void GrVkCaps::applyDriverCorrectnessWorkarounds(const VkPhysicalDevicePropertie fNewCBOnPipelineChange = true; } + // On Mali galaxy s7 we see lots of rendering issues when we suballocate VkImages. + if (kARM_VkVendor == properties.vendorID) { + fShouldAlwaysUseDedicatedImageMemory = true; + } + //////////////////////////////////////////////////////////////////////////// // GrCaps workarounds //////////////////////////////////////////////////////////////////////////// @@ -265,10 +276,6 @@ void GrVkCaps::applyDriverCorrectnessWorkarounds(const VkPhysicalDevicePropertie fMaxVertexAttributes = SkTMin(fMaxVertexAttributes, 32); } - if (kIntel_VkVendor == properties.vendorID) { - fCanUseWholeSizeOnFlushMappedMemory = false; - } - //////////////////////////////////////////////////////////////////////////// // GrShaderCaps workarounds //////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h index 0d11667b6d..2ed225423b 100644 --- a/src/gpu/vk/GrVkCaps.h +++ b/src/gpu/vk/GrVkCaps.h @@ -96,11 +96,9 @@ public: return fNewCBOnPipelineChange; } - // On certain Intel devices/drivers (IntelHD405) there is a bug if we try to flush non-coherent - // memory and pass in VK_WHOLE_SIZE. This returns whether or not it is safe to use VK_WHOLE_SIZE - // or not. - bool canUseWholeSizeOnFlushMappedMemory() const { - return fCanUseWholeSizeOnFlushMappedMemory; + // Returns true if we should always make dedicated allocations for VkImages. + bool shouldAlwaysUseDedicatedImageMemory() const { + return fShouldAlwaysUseDedicatedImageMemory; } /** @@ -190,16 +188,11 @@ private: StencilFormat fPreferedStencilFormat; bool fCanUseGLSLForShaderModule; - bool fMustDoCopiesFromOrigin; - bool fMustSubmitCommandsBeforeCopyOp; - bool fMustSleepOnTearDown; - bool fNewCBOnPipelineChange; - - bool fCanUseWholeSizeOnFlushMappedMemory; + bool fShouldAlwaysUseDedicatedImageMemory; typedef GrCaps INHERITED; }; diff --git a/src/gpu/vk/GrVkMemory.cpp b/src/gpu/vk/GrVkMemory.cpp index 1154490250..546e8d7f9c 100644 --- a/src/gpu/vk/GrVkMemory.cpp +++ b/src/gpu/vk/GrVkMemory.cpp @@ -98,10 +98,10 @@ bool GrVkMemory::AllocAndBindImageMemory(const GrVkGpu* gpu, GR_VK_CALL(gpu->vkInterface(), GetImageMemoryRequirements(gpu->device(), image, &memReqs)); AllocationPropertyFlags propFlags; - if (memReqs.size <= kMaxSmallImageSize) { - propFlags = AllocationPropertyFlags::kNone; - } else { + if (memReqs.size > kMaxSmallImageSize || gpu->vkCaps().shouldAlwaysUseDedicatedImageMemory()) { propFlags = AllocationPropertyFlags::kDedicatedAllocation; + } else { + propFlags = AllocationPropertyFlags::kNone; } if (!allocator->allocateMemoryForImage(image, propFlags, &memory)) { |