bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "include/core/SkTraceMemoryDump.h" |
| 9 | #include "include/gpu/GrContext.h" |
| 10 | #include "src/gpu/GrContextPriv.h" |
| 11 | #include "src/gpu/GrGpuResourcePriv.h" |
| 12 | #include "src/gpu/GrRenderTargetPriv.h" |
| 13 | #include "src/gpu/gl/GrGLGpu.h" |
| 14 | #include "src/gpu/gl/GrGLRenderTarget.h" |
| 15 | #include "src/gpu/gl/GrGLUtil.h" |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 16 | |
egdaniel | d803f27 | 2015-03-18 13:01:52 -0700 | [diff] [blame] | 17 | #define GPUGL static_cast<GrGLGpu*>(this->getGpu()) |
| 18 | #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X) |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 19 | |
bsalomon | 37dd331 | 2014-11-03 08:47:23 -0800 | [diff] [blame] | 20 | // Because this class is virtually derived from GrSurface we must explicitly call its constructor. |
kkinnunen | 2e6055b | 2016-04-22 01:48:29 -0700 | [diff] [blame] | 21 | // Constructor for wrapped render targets. |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 22 | GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu, |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 23 | const SkISize& size, |
| 24 | GrGLFormat format, |
| 25 | GrPixelConfig config, |
Brian Salomon | 27b4d8d | 2019-07-22 14:23:45 -0400 | [diff] [blame] | 26 | int sampleCount, |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 27 | const IDs& ids, |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 28 | GrGLStencilAttachment* stencil) |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 29 | : GrSurface(gpu, size, config, GrProtected::kNo) |
| 30 | , INHERITED(gpu, size, config, sampleCount, GrProtected::kNo, stencil) { |
| 31 | this->setFlags(gpu->glCaps(), ids); |
| 32 | this->init(format, ids); |
Brian Salomon | aa6ca0a | 2019-01-24 16:03:07 -0500 | [diff] [blame] | 33 | this->registerWithCacheWrapped(GrWrapCacheable::kNo); |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 34 | } |
| 35 | |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 36 | GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu, |
| 37 | const SkISize& size, |
| 38 | GrGLFormat format, |
| 39 | GrPixelConfig config, |
| 40 | int sampleCount, |
| 41 | const IDs& ids) |
| 42 | : GrSurface(gpu, size, config, GrProtected::kNo) |
| 43 | , INHERITED(gpu, size, config, sampleCount, GrProtected::kNo) { |
| 44 | this->setFlags(gpu->glCaps(), ids); |
| 45 | this->init(format, ids); |
bsalomon@google.com | 5bfc217 | 2011-07-29 20:29:05 +0000 | [diff] [blame] | 46 | } |
| 47 | |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 48 | inline void GrGLRenderTarget::setFlags(const GrGLCaps& glCaps, const IDs& idDesc) { |
Greg Daniel | a070ed7 | 2018-04-26 16:31:38 -0400 | [diff] [blame] | 49 | if (!idDesc.fRTFBOID) { |
| 50 | this->setGLRTFBOIDIs0(); |
| 51 | } |
csmartdalton | f963599 | 2016-08-10 11:09:07 -0700 | [diff] [blame] | 52 | } |
| 53 | |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 54 | void GrGLRenderTarget::init(GrGLFormat format, const IDs& idDesc) { |
| 55 | fRTFBOID = idDesc.fRTFBOID; |
| 56 | fTexFBOID = idDesc.fTexFBOID; |
| 57 | fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID; |
| 58 | fRTFBOOwnership = idDesc.fRTFBOOwnership; |
| 59 | fRTFormat = format; |
Robert Phillips | 29e52f1 | 2016-11-03 10:19:14 -0400 | [diff] [blame] | 60 | fNumSamplesOwnedPerPixel = this->totalSamples(); |
senorblanco | d298121 | 2015-04-30 12:06:10 -0700 | [diff] [blame] | 61 | } |
| 62 | |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 63 | sk_sp<GrGLRenderTarget> GrGLRenderTarget::MakeWrapped(GrGLGpu* gpu, |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 64 | const SkISize& size, |
| 65 | GrGLFormat format, |
| 66 | GrPixelConfig config, |
Brian Salomon | 27b4d8d | 2019-07-22 14:23:45 -0400 | [diff] [blame] | 67 | int sampleCount, |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 68 | const IDs& idDesc, |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 69 | int stencilBits) { |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 70 | GrGLStencilAttachment* sb = nullptr; |
| 71 | if (stencilBits) { |
| 72 | GrGLStencilAttachment::IDDesc sbDesc; |
| 73 | GrGLStencilAttachment::Format format; |
| 74 | format.fInternalFormat = GrGLStencilAttachment::kUnknownInternalFormat; |
| 75 | format.fPacked = false; |
| 76 | format.fStencilBits = stencilBits; |
| 77 | format.fTotalBits = stencilBits; |
Robert Phillips | cb2e235 | 2017-08-30 16:44:40 -0400 | [diff] [blame] | 78 | // Ownership of sb is passed to the GrRenderTarget so doesn't need to be deleted |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 79 | sb = new GrGLStencilAttachment(gpu, sbDesc, size.width(), size.height(), sampleCount, |
| 80 | format); |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 81 | } |
Brian Salomon | 27b4d8d | 2019-07-22 14:23:45 -0400 | [diff] [blame] | 82 | return sk_sp<GrGLRenderTarget>( |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 83 | new GrGLRenderTarget(gpu, size, format, config, sampleCount, idDesc, sb)); |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 84 | } |
| 85 | |
Greg Daniel | faa095e | 2017-12-19 13:15:02 -0500 | [diff] [blame] | 86 | GrBackendRenderTarget GrGLRenderTarget::getBackendRenderTarget() const { |
| 87 | GrGLFramebufferInfo fbi; |
| 88 | fbi.fFBOID = fRTFBOID; |
Brian Salomon | 1c53a9f | 2019-08-12 14:10:12 -0400 | [diff] [blame] | 89 | fbi.fFormat = GrGLFormatToEnum(this->format()); |
Brian Salomon | 0c51eea | 2018-03-09 17:02:09 -0500 | [diff] [blame] | 90 | int numStencilBits = 0; |
| 91 | if (GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAttachment()) { |
| 92 | numStencilBits = stencil->bits(); |
| 93 | } |
Greg Daniel | faa095e | 2017-12-19 13:15:02 -0500 | [diff] [blame] | 94 | |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 95 | return GrBackendRenderTarget( |
| 96 | this->width(), this->height(), this->numSamples(), numStencilBits, fbi); |
Greg Daniel | faa095e | 2017-12-19 13:15:02 -0500 | [diff] [blame] | 97 | } |
| 98 | |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 99 | GrBackendFormat GrGLRenderTarget::backendFormat() const { |
| 100 | // We should never have a GrGLRenderTarget (even a textureable one with a target that is not |
| 101 | // texture 2D. |
Brian Salomon | ea4ad30 | 2019-08-07 13:04:55 -0400 | [diff] [blame] | 102 | return GrBackendFormat::MakeGL(GrGLFormatToEnum(fRTFormat), GR_GL_TEXTURE_2D); |
Greg Daniel | 4065d45 | 2018-11-16 15:43:41 -0500 | [diff] [blame] | 103 | } |
| 104 | |
senorblanco | d298121 | 2015-04-30 12:06:10 -0700 | [diff] [blame] | 105 | size_t GrGLRenderTarget::onGpuMemorySize() const { |
Brian Salomon | bb5711a | 2017-05-17 13:49:59 -0400 | [diff] [blame] | 106 | return GrSurface::ComputeSize(this->config(), this->width(), this->height(), |
Greg Daniel | e252f08 | 2017-10-23 16:05:23 -0400 | [diff] [blame] | 107 | fNumSamplesOwnedPerPixel, GrMipMapped::kNo); |
bsalomon@google.com | 5bfc217 | 2011-07-29 20:29:05 +0000 | [diff] [blame] | 108 | } |
| 109 | |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 110 | bool GrGLRenderTarget::completeStencilAttachment() { |
| 111 | GrGLGpu* gpu = this->getGLGpu(); |
| 112 | const GrGLInterface* interface = gpu->glInterface(); |
| 113 | GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAttachment(); |
| 114 | if (nullptr == stencil) { |
egdaniel | 79bd2ae | 2015-09-15 08:46:13 -0700 | [diff] [blame] | 115 | GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, |
| 116 | GR_GL_STENCIL_ATTACHMENT, |
| 117 | GR_GL_RENDERBUFFER, 0)); |
| 118 | GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, |
| 119 | GR_GL_DEPTH_ATTACHMENT, |
| 120 | GR_GL_RENDERBUFFER, 0)); |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 121 | #ifdef SK_DEBUG |
robertphillips | fa7ff47 | 2016-04-21 11:27:43 -0700 | [diff] [blame] | 122 | if (kChromium_GrGLDriver != gpu->glContext().driver()) { |
| 123 | // This check can cause problems in Chromium if the context has been asynchronously |
| 124 | // abandoned (see skbug.com/5200) |
| 125 | GrGLenum status; |
| 126 | GR_GL_CALL_RET(interface, status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); |
| 127 | SkASSERT(GR_GL_FRAMEBUFFER_COMPLETE == status); |
| 128 | } |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 129 | #endif |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 130 | return true; |
| 131 | } else { |
| 132 | const GrGLStencilAttachment* glStencil = static_cast<const GrGLStencilAttachment*>(stencil); |
| 133 | GrGLuint rb = glStencil->renderbufferID(); |
| 134 | |
| 135 | gpu->invalidateBoundRenderTarget(); |
Adrienne Walker | 4ee8851 | 2018-05-17 11:37:14 -0700 | [diff] [blame] | 136 | gpu->bindFramebuffer(GR_GL_FRAMEBUFFER, this->renderFBOID()); |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 137 | GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, |
| 138 | GR_GL_STENCIL_ATTACHMENT, |
| 139 | GR_GL_RENDERBUFFER, rb)); |
| 140 | if (glStencil->format().fPacked) { |
| 141 | GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, |
| 142 | GR_GL_DEPTH_ATTACHMENT, |
| 143 | GR_GL_RENDERBUFFER, rb)); |
| 144 | } else { |
| 145 | GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, |
| 146 | GR_GL_DEPTH_ATTACHMENT, |
| 147 | GR_GL_RENDERBUFFER, 0)); |
| 148 | } |
| 149 | |
Adrienne Walker | 3ed3399 | 2018-05-15 11:44:34 -0700 | [diff] [blame] | 150 | |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 151 | #ifdef SK_DEBUG |
robertphillips | fa7ff47 | 2016-04-21 11:27:43 -0700 | [diff] [blame] | 152 | if (kChromium_GrGLDriver != gpu->glContext().driver()) { |
| 153 | // This check can cause problems in Chromium if the context has been asynchronously |
| 154 | // abandoned (see skbug.com/5200) |
| 155 | GrGLenum status; |
| 156 | GR_GL_CALL_RET(interface, status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); |
| 157 | SkASSERT(GR_GL_FRAMEBUFFER_COMPLETE == status); |
| 158 | } |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 159 | #endif |
| 160 | return true; |
| 161 | } |
| 162 | } |
| 163 | |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 164 | void GrGLRenderTarget::onRelease() { |
kkinnunen | 2e6055b | 2016-04-22 01:48:29 -0700 | [diff] [blame] | 165 | if (GrBackendObjectOwnership::kBorrowed != fRTFBOOwnership) { |
Adrienne Walker | 4ee8851 | 2018-05-17 11:37:14 -0700 | [diff] [blame] | 166 | GrGLGpu* gpu = this->getGLGpu(); |
egdaniel | d803f27 | 2015-03-18 13:01:52 -0700 | [diff] [blame] | 167 | if (fTexFBOID) { |
Adrienne Walker | 4ee8851 | 2018-05-17 11:37:14 -0700 | [diff] [blame] | 168 | gpu->deleteFramebuffer(fTexFBOID); |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 169 | } |
egdaniel | d803f27 | 2015-03-18 13:01:52 -0700 | [diff] [blame] | 170 | if (fRTFBOID && fRTFBOID != fTexFBOID) { |
Adrienne Walker | 4ee8851 | 2018-05-17 11:37:14 -0700 | [diff] [blame] | 171 | gpu->deleteFramebuffer(fRTFBOID); |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 172 | } |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 173 | if (fMSColorRenderbufferID) { |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 174 | GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID)); |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 175 | } |
| 176 | } |
egdaniel | d803f27 | 2015-03-18 13:01:52 -0700 | [diff] [blame] | 177 | fRTFBOID = 0; |
| 178 | fTexFBOID = 0; |
| 179 | fMSColorRenderbufferID = 0; |
robertphillips@google.com | d6bbbf8 | 2012-09-05 15:46:34 +0000 | [diff] [blame] | 180 | INHERITED::onRelease(); |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | void GrGLRenderTarget::onAbandon() { |
egdaniel | d803f27 | 2015-03-18 13:01:52 -0700 | [diff] [blame] | 184 | fRTFBOID = 0; |
| 185 | fTexFBOID = 0; |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 186 | fMSColorRenderbufferID = 0; |
robertphillips@google.com | d6bbbf8 | 2012-09-05 15:46:34 +0000 | [diff] [blame] | 187 | INHERITED::onAbandon(); |
bsalomon@google.com | aa5b673 | 2011-07-29 15:13:20 +0000 | [diff] [blame] | 188 | } |
egdaniel | ec00d94 | 2015-09-14 12:56:10 -0700 | [diff] [blame] | 189 | |
| 190 | GrGLGpu* GrGLRenderTarget::getGLGpu() const { |
| 191 | SkASSERT(!this->wasDestroyed()); |
| 192 | return static_cast<GrGLGpu*>(this->getGpu()); |
| 193 | } |
| 194 | |
kkinnunen | 2e6055b | 2016-04-22 01:48:29 -0700 | [diff] [blame] | 195 | bool GrGLRenderTarget::canAttemptStencilAttachment() const { |
Robert Phillips | 9da87e0 | 2019-02-04 13:26:26 -0500 | [diff] [blame] | 196 | if (this->getGpu()->getContext()->priv().caps()->avoidStencilBuffers()) { |
Eric Karl | 5c77975 | 2017-05-08 12:02:07 -0700 | [diff] [blame] | 197 | return false; |
| 198 | } |
| 199 | |
ericrk | c402518 | 2016-05-04 12:01:58 -0700 | [diff] [blame] | 200 | // Only modify the FBO's attachments if we have created the FBO. Public APIs do not currently |
| 201 | // allow for borrowed FBO ownership, so we can safely assume that if an object is owned, |
| 202 | // Skia created it. |
| 203 | return this->fRTFBOOwnership == GrBackendObjectOwnership::kOwned; |
kkinnunen | 2e6055b | 2016-04-22 01:48:29 -0700 | [diff] [blame] | 204 | } |
| 205 | |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 206 | void GrGLRenderTarget::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
Eric Karl | af77002 | 2018-03-19 13:04:03 -0700 | [diff] [blame] | 207 | // Don't check this->fRefsWrappedObjects, as we might be the base of a GrGLTextureRenderTarget |
| 208 | // which is multiply inherited from both ourselves and a texture. In these cases, one part |
| 209 | // (texture, rt) may be wrapped, while the other is owned by Skia. |
| 210 | bool refsWrappedRenderTargetObjects = |
| 211 | this->fRTFBOOwnership == GrBackendObjectOwnership::kBorrowed; |
| 212 | if (refsWrappedRenderTargetObjects && !traceMemoryDump->shouldDumpWrappedObjects()) { |
| 213 | return; |
| 214 | } |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 215 | |
Eric Karl | af77002 | 2018-03-19 13:04:03 -0700 | [diff] [blame] | 216 | // Don't log the framebuffer, as the framebuffer itself doesn't contribute to meaningful |
| 217 | // memory usage. It is always a wrapper around either: |
| 218 | // - a texture, which is owned elsewhere, and will be dumped there |
| 219 | // - a renderbuffer, which will be dumped below. |
| 220 | |
| 221 | // Log any renderbuffer's contribution to memory. |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 222 | if (fMSColorRenderbufferID) { |
Brian Salomon | bb5711a | 2017-05-17 13:49:59 -0400 | [diff] [blame] | 223 | size_t size = GrSurface::ComputeSize(this->config(), this->width(), this->height(), |
Greg Daniel | e252f08 | 2017-10-23 16:05:23 -0400 | [diff] [blame] | 224 | this->msaaSamples(), GrMipMapped::kNo); |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 225 | |
| 226 | // Due to this resource having both a texture and a renderbuffer component, dump as |
| 227 | // skia/gpu_resources/resource_#/renderbuffer |
Derek Sollenberger | cf6da8c | 2018-03-29 13:40:02 -0400 | [diff] [blame] | 228 | SkString resourceName = this->getResourceName(); |
| 229 | resourceName.append("/renderbuffer"); |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 230 | |
Derek Sollenberger | cf6da8c | 2018-03-29 13:40:02 -0400 | [diff] [blame] | 231 | this->dumpMemoryStatisticsPriv(traceMemoryDump, resourceName, "RenderTarget", size); |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 232 | |
| 233 | SkString renderbuffer_id; |
| 234 | renderbuffer_id.appendU32(fMSColorRenderbufferID); |
Derek Sollenberger | cf6da8c | 2018-03-29 13:40:02 -0400 | [diff] [blame] | 235 | traceMemoryDump->setMemoryBacking(resourceName.c_str(), "gl_renderbuffer", |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 236 | renderbuffer_id.c_str()); |
| 237 | } |
| 238 | } |
| 239 | |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 240 | int GrGLRenderTarget::msaaSamples() const { |
| 241 | if (fTexFBOID == kUnresolvableFBOID || fTexFBOID != fRTFBOID) { |
| 242 | // If the render target's FBO is external (fTexFBOID == kUnresolvableFBOID), or if we own |
| 243 | // the render target's FBO (fTexFBOID == fRTFBOID) then we use the provided sample count. |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 244 | return this->numSamples(); |
ericrk | 0a5fa48 | 2015-09-15 14:16:10 -0700 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | // When fTexFBOID == fRTFBOID, we either are not using MSAA, or MSAA is auto resolving, so use |
| 248 | // 0 for the sample count. |
| 249 | return 0; |
| 250 | } |
| 251 | |
| 252 | int GrGLRenderTarget::totalSamples() const { |
| 253 | int total_samples = this->msaaSamples(); |
| 254 | |
| 255 | if (fTexFBOID != kUnresolvableFBOID) { |
| 256 | // If we own the resolve buffer then that is one more sample per pixel. |
| 257 | total_samples += 1; |
| 258 | } |
| 259 | |
| 260 | return total_samples; |
| 261 | } |