Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: src/gpu/vk/GrVkTexture.cpp

Issue 2146103002: Update RT views and framebuffer in vulkan after mipmaping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkTexture.h ('k') | src/gpu/vk/GrVkTextureRenderTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkTexture.cpp
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index 5d15311cbfe7e079d4bd5275938a25780365b24b..07da037b3b3d992d8926560f88ac117e4da627fc 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;
@@ -174,7 +175,6 @@ bool GrVkTexture::reallocForMipmap(const GrVkGpu* gpu, uint32_t mipLevels) {
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 @@ 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) {
« no previous file with comments | « src/gpu/vk/GrVkTexture.h ('k') | src/gpu/vk/GrVkTextureRenderTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698