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

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

Issue 2256843002: Don't add the resolve attachment to vulkan render passes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 4 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
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkRenderPass.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkGpuCommandBuffer.cpp
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
index 77a038a9577999a245c829427d31298e9495978a..f49b180e3823819eb3ced86d733d072bdf87071e 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
@@ -100,12 +100,15 @@ 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,
- VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
- VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
- false);
+ // 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()
+ : fRenderTarget;
+ targetImage->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 +121,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,
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkRenderPass.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698