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

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

Issue 1756493002: Use VkPipelineCaches during VkPipeline creation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix mipmap issues Created 4 years, 10 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/GrVkPipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkGpu.cpp
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 6b36cdb7c801dd4e7dd09374268a0e5e00ff0e91..a208aed456405f8184f14cfc7eaed0e9c6dbda2b 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -180,6 +180,8 @@ GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options,
fVkCaps.reset(new GrVkCaps(options, fInterface, physDev));
fCaps.reset(SkRef(fVkCaps.get()));
+ fResourceProvider.init();
+
fCurrentCmdBuffer = fResourceProvider.createCommandBuffer();
SkASSERT(fCurrentCmdBuffer);
fCurrentCmdBuffer->begin(this);
@@ -267,6 +269,9 @@ bool GrVkGpu::onWritePixels(GrSurface* surface,
}
// TODO: We're ignoring MIP levels here.
+ if (texels.empty() || !texels.begin()->fPixels) {
+ return false;
+ }
// We assume Vulkan doesn't do sRGB <-> linear conversions when reading and writing pixels.
if (GrPixelConfigIsSRGB(surface->config()) != GrPixelConfigIsSRGB(config)) {
@@ -537,7 +542,7 @@ GrTexture* GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::Li
}
// TODO: We're ignoring MIP levels here.
- if (!texels.empty()) {
+ if (!texels.empty() && texels.begin()->fPixels) {
if (!this->uploadTexData(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
texels.begin()->fPixels, texels.begin()->fRowBytes)) {
tex->unref();
« no previous file with comments | « no previous file | src/gpu/vk/GrVkPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698