Update RT views and framebuffer in vulkan after mipmaping

I've also changed it so all attachment views (texture, color, and resolve) are created separately and not shared with each other. This just added a lot more complexity than we were probably even saving in time.

A quick fix to make sure we don't reuse keys in resource tracking also
got merged into this change.

BUG=skia:5223
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146103002

Review-Url: https://codereview.chromium.org/2146103002
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index b0dd107..bf399a8 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 @@
     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;
@@ -174,7 +175,6 @@
         return false;
     }
 
-    // Does this even make sense for rendertargets?
     bool renderTarget = SkToBool(fDesc.fFlags & kRenderTarget_GrSurfaceFlag);
 
     VkImageUsageFlags usageFlags = VK_IMAGE_USAGE_SAMPLED_BIT;
@@ -209,6 +209,14 @@
         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) {