Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: src/gpu/vk/GrVkGpuCommandBuffer.cpp

Issue 2336763002: Lots of little cleanup improvements to Vulkan (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/vk/GrVkGpuCommandBuffer.cpp
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
index e3c7cb77cc2692fd50464d93b14a358b4253330f..63fddc1459cc14e4c92d3f7a3f63c7bfc78de59e 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
@@ -57,7 +57,8 @@ GrVkGpuCommandBuffer::GrVkGpuCommandBuffer(GrVkGpu* gpu,
const LoadAndStoreInfo& stencilInfo)
: fGpu(gpu)
, fRenderTarget(target)
- , fIsEmpty(true) {
+ , fIsEmpty(true)
+ , fHasClearStart(false) {
VkAttachmentLoadOp vkLoadOp;
VkAttachmentStoreOp vkStoreOp;
@@ -101,6 +102,12 @@ void GrVkGpuCommandBuffer::end() {
}
void GrVkGpuCommandBuffer::onSubmit(const SkIRect& bounds) {
+ if (fIsEmpty && !fHasClearStart) {
egdaniel 2016/09/12 20:40:09 If we grab a texture to which we immediately want
+ // We have sumbitted now actual draw commands the the command buffer and we are not using
Brian Osman 2016/09/12 20:45:05 s/now/no/ ? s/the the/to the/ ?
jvanverth1 2016/09/12 20:48:23 submitted no actual draw commands to the
egdaniel 2016/09/12 21:14:32 Done.
+ // the render pass to do a clear so there is no need to submit anything.
+ return;
+ }
+
// Change layout of our render target so it can be used as the color attachment. Currently
// we don't attach the resolve to the framebuffer so no need to change its layout.
GrVkImage* targetImage = fRenderTarget->msaaImage() ? fRenderTarget->msaaImage()

Powered by Google App Engine
This is Rietveld 408576698