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

Unified Diff: src/gpu/GrGpu.cpp

Issue 2104353002: Add discard support to Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 4 years, 6 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 | « no previous file | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 0a2592d38046085131bc9e3a41c96e3f6fa6e0a1..1397845f42de6d9bcf7d0ef931ee1e3672bae285 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -178,6 +178,14 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, SkBudgeted budget
fStats.incTextureUploads();
}
}
+ // This is a current work around to get discards into newly created textures. Once we are in
+ // MDB world, we should remove this code a rely on the draw target having specified load
+ // operations.
+ if (isRT && texels.empty()) {
+ GrRenderTarget* rt = tex->asRenderTarget();
+ SkASSERT(rt);
+ rt->discard();
+ }
}
return tex;
}
« no previous file with comments | « no previous file | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698