aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl/GrMtlRenderTarget.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/mtl/GrMtlRenderTarget.h')
-rw-r--r--src/gpu/mtl/GrMtlRenderTarget.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/mtl/GrMtlRenderTarget.h b/src/gpu/mtl/GrMtlRenderTarget.h
index 4dac306e7e..83e7d3c240 100644
--- a/src/gpu/mtl/GrMtlRenderTarget.h
+++ b/src/gpu/mtl/GrMtlRenderTarget.h
@@ -63,8 +63,11 @@ protected:
// This accounts for the texture's memory and any MSAA renderbuffer's memory.
size_t onGpuMemorySize() const override {
+ int numColorSamples = this->numColorSamples();
// The plus 1 is to account for the resolve texture or if not using msaa the RT itself
- int numColorSamples = this->numColorSamples() + 1;
+ if (numColorSamples > 1) {
+ ++numColorSamples;
+ }
return GrSurface::ComputeSize(this->config(), this->width(), this->height(),
numColorSamples, GrMipMapped::kNo);
}