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

Side by Side Diff: src/gpu/vk/GrVkRenderTarget.cpp

Issue 1977113002: Fix msaa on GrVkRenderTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@backendTexture
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrVkRenderTarget.h" 8 #include "GrVkRenderTarget.h"
9 9
10 #include "GrRenderTargetPriv.h" 10 #include "GrRenderTargetPriv.h"
(...skipping 17 matching lines...) Expand all
28 const GrVkImageInfo& msaaInfo, 28 const GrVkImageInfo& msaaInfo,
29 const GrVkImageView* colorAttachmentView, 29 const GrVkImageView* colorAttachmentView,
30 const GrVkImageView* resolveAttachmentView, 30 const GrVkImageView* resolveAttachmentView,
31 GrVkImage::Wrapped wrapped) 31 GrVkImage::Wrapped wrapped)
32 : GrSurface(gpu, desc) 32 : GrSurface(gpu, desc)
33 , GrVkImage(info, wrapped) 33 , GrVkImage(info, wrapped)
34 // for the moment we only support 1:1 color to stencil 34 // for the moment we only support 1:1 color to stencil
35 , GrRenderTarget(gpu, desc, kUnified_SampleConfig) 35 , GrRenderTarget(gpu, desc, kUnified_SampleConfig)
36 , fFramebuffer(nullptr) 36 , fFramebuffer(nullptr)
37 , fColorAttachmentView(colorAttachmentView) 37 , fColorAttachmentView(colorAttachmentView)
38 , fMSAAImage(new GrVkImage(info, GrVkImage::kNot_Wrapped)) 38 , fMSAAImage(new GrVkImage(msaaInfo, GrVkImage::kNot_Wrapped))
39 , fResolveAttachmentView(resolveAttachmentView) 39 , fResolveAttachmentView(resolveAttachmentView)
40 , fCachedSimpleRenderPass(nullptr) { 40 , fCachedSimpleRenderPass(nullptr) {
41 SkASSERT(desc.fSampleCnt); 41 SkASSERT(desc.fSampleCnt);
42 // The plus 1 is to account for the resolve texture. 42 // The plus 1 is to account for the resolve texture.
43 fColorValuesPerPixel = desc.fSampleCnt + 1; // TODO: this still correct? 43 fColorValuesPerPixel = desc.fSampleCnt + 1; // TODO: this still correct?
44 this->createFramebuffer(gpu); 44 this->createFramebuffer(gpu);
45 this->registerWithCache(budgeted); 45 this->registerWithCache(budgeted);
46 } 46 }
47 47
48 // We're virtually derived from GrSurface (via GrRenderTarget) so its 48 // We're virtually derived from GrSurface (via GrRenderTarget) so its
49 // constructor must be explicitly called. 49 // constructor must be explicitly called.
50 GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu, 50 GrVkRenderTarget::GrVkRenderTarget(GrVkGpu* gpu,
51 const GrSurfaceDesc& desc, 51 const GrSurfaceDesc& desc,
52 const GrVkImageInfo& info, 52 const GrVkImageInfo& info,
53 const GrVkImageInfo& msaaInfo, 53 const GrVkImageInfo& msaaInfo,
54 const GrVkImageView* colorAttachmentView, 54 const GrVkImageView* colorAttachmentView,
55 const GrVkImageView* resolveAttachmentView, 55 const GrVkImageView* resolveAttachmentView,
56 GrVkImage::Wrapped wrapped) 56 GrVkImage::Wrapped wrapped)
57 : GrSurface(gpu, desc) 57 : GrSurface(gpu, desc)
58 , GrVkImage(info, wrapped) 58 , GrVkImage(info, wrapped)
59 // for the moment we only support 1:1 color to stencil 59 // for the moment we only support 1:1 color to stencil
60 , GrRenderTarget(gpu, desc, kUnified_SampleConfig) 60 , GrRenderTarget(gpu, desc, kUnified_SampleConfig)
61 , fFramebuffer(nullptr) 61 , fFramebuffer(nullptr)
62 , fColorAttachmentView(colorAttachmentView) 62 , fColorAttachmentView(colorAttachmentView)
63 , fMSAAImage(new GrVkImage(info, GrVkImage::kNot_Wrapped)) 63 , fMSAAImage(new GrVkImage(msaaInfo, GrVkImage::kNot_Wrapped))
64 , fResolveAttachmentView(resolveAttachmentView) 64 , fResolveAttachmentView(resolveAttachmentView)
65 , fCachedSimpleRenderPass(nullptr) { 65 , fCachedSimpleRenderPass(nullptr) {
66 SkASSERT(desc.fSampleCnt); 66 SkASSERT(desc.fSampleCnt);
67 // The plus 1 is to account for the resolve texture. 67 // The plus 1 is to account for the resolve texture.
68 fColorValuesPerPixel = desc.fSampleCnt + 1; // TODO: this still correct? 68 fColorValuesPerPixel = desc.fSampleCnt + 1; // TODO: this still correct?
69 this->createFramebuffer(gpu); 69 this->createFramebuffer(gpu);
70 } 70 }
71 71
72 // We're virtually derived from GrSurface (via GrRenderTarget) so its 72 // We're virtually derived from GrSurface (via GrRenderTarget) so its
73 // constructor must be explicitly called. 73 // constructor must be explicitly called.
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 380 }
381 381
382 return nullptr; 382 return nullptr;
383 } 383 }
384 384
385 385
386 GrVkGpu* GrVkRenderTarget::getVkGpu() const { 386 GrVkGpu* GrVkRenderTarget::getVkGpu() const {
387 SkASSERT(!this->wasDestroyed()); 387 SkASSERT(!this->wasDestroyed());
388 return static_cast<GrVkGpu*>(this->getGpu()); 388 return static_cast<GrVkGpu*>(this->getGpu());
389 } 389 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698