aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkGpu.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-03-22 15:45:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-22 20:24:31 +0000
commit22bc8653d704584e13f35844dafb5ddeb9989127 (patch)
tree36ad9888210133f8b0242c7155ce104aaa3156a8 /src/gpu/vk/GrVkGpu.cpp
parent5e150851d0dd5ddb161449b44edf1bf52d18ac5a (diff)
Add AMD work around in Vulkan to create a new secondary command buffer
whenever we change the VkPipeline. All these secondary CBs are still submitted within one render pass. This works around the amd bug linked in the bug below. It will probably cause a slight performance hit, so I will track it on perf and revert if the hit is significant. BUG=skia:6406 Change-Id: I48ff39ab36cfa96a67397f745ff65fe8b199f02b Reviewed-on: https://skia-review.googlesource.com/9987 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkGpu.cpp')
-rw-r--r--src/gpu/vk/GrVkGpu.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 6412a55d0c..e1ff70f7d0 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1794,7 +1794,7 @@ void adjust_bounds_to_granularity(SkIRect* dstBounds, const SkIRect& srcBounds,
}
}
-void GrVkGpu::submitSecondaryCommandBuffer(GrVkSecondaryCommandBuffer* buffer,
+void GrVkGpu::submitSecondaryCommandBuffer(const SkTArray<GrVkSecondaryCommandBuffer*>& buffers,
const GrVkRenderPass* renderPass,
const VkClearValue* colorClear,
GrVkRenderTarget* target,
@@ -1820,7 +1820,9 @@ void GrVkGpu::submitSecondaryCommandBuffer(GrVkSecondaryCommandBuffer* buffer,
}
fCurrentCmdBuffer->beginRenderPass(this, renderPass, colorClear, *target, *pBounds, true);
- fCurrentCmdBuffer->executeCommands(this, buffer);
+ for (int i = 0; i < buffers.count(); ++i) {
+ fCurrentCmdBuffer->executeCommands(this, buffers[i]);
+ }
fCurrentCmdBuffer->endRenderPass(this);
this->didWriteToSurface(target, &bounds);