aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkRenderTarget.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/vk/GrVkRenderTarget.h')
-rw-r--r--src/gpu/vk/GrVkRenderTarget.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gpu/vk/GrVkRenderTarget.h b/src/gpu/vk/GrVkRenderTarget.h
index eb297a8a1d..02d4add455 100644
--- a/src/gpu/vk/GrVkRenderTarget.h
+++ b/src/gpu/vk/GrVkRenderTarget.h
@@ -99,8 +99,11 @@ protected:
// This accounts for the texture's memory and any MSAA renderbuffer's memory.
size_t onGpuMemorySize() const override {
- // The plus 1 is to account for the resolve texture or if not using msaa the RT itself
- int numColorSamples = this->numColorSamples() + 1;
+ int numColorSamples = this->numColorSamples();
+ if (numColorSamples > 1) {
+ // Add one to account for the resolved VkImage.
+ numColorSamples += 1;
+ }
return GrSurface::ComputeSize(this->config(), this->width(), this->height(),
numColorSamples, GrMipMapped::kNo);
}