Index: src/gpu/vk/GrVkTexture.cpp |
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp |
index 5d15311cbfe7e079d4bd5275938a25780365b24b..7d9e3186b84be9f835eb98ce765c6d155bc4736d 100644 |
--- a/src/gpu/vk/GrVkTexture.cpp |
+++ b/src/gpu/vk/GrVkTexture.cpp |
@@ -9,6 +9,7 @@ |
#include "GrVkGpu.h" |
#include "GrVkImageView.h" |
#include "GrTexturePriv.h" |
+#include "GrVkTextureRenderTarget.h" |
#include "GrVkUtil.h" |
#include "vk/GrVkTypes.h" |
@@ -161,7 +162,7 @@ const GrVkImageView* GrVkTexture::textureView(bool allowSRGB) { |
return fLinearTextureView; |
} |
-bool GrVkTexture::reallocForMipmap(const GrVkGpu* gpu, uint32_t mipLevels) { |
+bool GrVkTexture::reallocForMipmap(GrVkGpu* gpu, uint32_t mipLevels) { |
if (mipLevels == 1) { |
// don't need to do anything for a 1x1 texture |
return false; |
@@ -209,6 +210,14 @@ bool GrVkTexture::reallocForMipmap(const GrVkGpu* gpu, uint32_t mipLevels) { |
return false; |
} |
+ if (renderTarget) { |
+ GrVkTextureRenderTarget* texRT = static_cast<GrVkTextureRenderTarget*>(this); |
+ if (!texRT->updateForMipmap(gpu, info)) { |
+ GrVkImage::DestroyImageInfo(gpu, &info); |
+ return false; |
+ } |
+ } |
+ |
oldResource->unref(gpu); |
oldView->unref(gpu); |
if (fLinearTextureView) { |