Index: src/gpu/vk/GrVkGpuCommandBuffer.cpp |
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp |
index 77a038a9577999a245c829427d31298e9495978a..7b1d70d41d5200511be7e731603b3fa497f38ff1 100644 |
--- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp |
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp |
@@ -100,12 +100,21 @@ void GrVkGpuCommandBuffer::end() { |
} |
void GrVkGpuCommandBuffer::onSubmit(const SkIRect& bounds) { |
- // Change layout of our render target so it can be used as the color attachment |
- fRenderTarget->setImageLayout(fGpu, |
+ // Change layout of our render target so it can be used as the color attachment. Currently |
+ // we dont' attach the resolve to the framebuffer so no need to change its layout. |
jvanverth1
2016/08/26 15:03:19
don't
egdaniel
2016/08/26 15:48:45
Done.
|
+ if (GrVkImage* msaaImage = fRenderTarget->msaaImage()) { |
jvanverth1
2016/08/26 15:03:19
How about
GrVkImage* layoutImage = fRenderTarget-
egdaniel
2016/08/26 15:48:45
Done.
|
+ msaaImage->setImageLayout(fGpu, |
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, |
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, |
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, |
false); |
+ } else { |
+ fRenderTarget->setImageLayout(fGpu, |
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, |
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, |
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, |
+ false); |
+ } |
// If we are using a stencil attachment we also need to update its layout |
if (GrStencilAttachment* stencil = fRenderTarget->renderTargetPriv().getStencilAttachment()) { |
@@ -118,14 +127,6 @@ void GrVkGpuCommandBuffer::onSubmit(const SkIRect& bounds) { |
false); |
} |
- if (GrVkImage* msaaImage = fRenderTarget->msaaImage()) { |
- msaaImage->setImageLayout(fGpu, |
- VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, |
- VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, |
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, |
- false); |
- } |
- |
for (int i = 0; i < fSampledImages.count(); ++i) { |
fSampledImages[i]->setImageLayout(fGpu, |
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, |