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

Side by Side Diff: src/gpu/vk/GrVkGpu.cpp

Issue 1818093002: Minor fixes to avoid NVPR in Vulkan and provide good GrVkGpu teardown. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrVkGpu.h" 8 #include "GrVkGpu.h"
9 9
10 #include "GrContextOptions.h" 10 #include "GrContextOptions.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } 349 }
350 #endif 350 #endif
351 } 351 }
352 352
353 GrVkGpu::~GrVkGpu() { 353 GrVkGpu::~GrVkGpu() {
354 shaderc_compiler_release(fCompiler); 354 shaderc_compiler_release(fCompiler);
355 fCurrentCmdBuffer->end(this); 355 fCurrentCmdBuffer->end(this);
356 fCurrentCmdBuffer->unref(this); 356 fCurrentCmdBuffer->unref(this);
357 357
358 // wait for all commands to finish 358 // wait for all commands to finish
359 fResourceProvider.checkCommandBuffers();
359 VkResult res = VK_CALL(QueueWaitIdle(fQueue)); 360 VkResult res = VK_CALL(QueueWaitIdle(fQueue));
360 SkASSERT(res == VK_SUCCESS); 361 // VK_ERROR_DEVICE_LOST is acceptable when tearing down (see 4.2.4 in spec)
361 362 SkASSERT(VK_SUCCESS == res || VK_ERROR_DEVICE_LOST == res);
363
362 // must call this just before we destroy the VkDevice 364 // must call this just before we destroy the VkDevice
363 fResourceProvider.destroyResources(); 365 fResourceProvider.destroyResources();
364 366
365 #ifdef SK_DEBUG 367 #ifdef SK_DEBUG
366 VK_CALL(DestroyDebugReportCallbackEXT(fVkInstance, fCallback, nullptr)); 368 VK_CALL(DestroyDebugReportCallbackEXT(fVkInstance, fCallback, nullptr));
367 #endif 369 #endif
368 370
369 VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr)); 371 VK_CALL(DestroyCommandPool(fDevice, fCmdPool, nullptr));
370 VK_CALL(DestroyDevice(fDevice, nullptr)); 372 VK_CALL(DestroyDevice(fDevice, nullptr));
371 VK_CALL(DestroyInstance(fVkInstance, nullptr)); 373 VK_CALL(DestroyInstance(fVkInstance, nullptr));
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 int set_a_break_pt_here = 9; 1663 int set_a_break_pt_here = 9;
1662 aglSwapBuffers(aglGetCurrentContext()); 1664 aglSwapBuffers(aglGetCurrentContext());
1663 #elif defined(SK_BUILD_FOR_WIN32) 1665 #elif defined(SK_BUILD_FOR_WIN32)
1664 SwapBuf(); 1666 SwapBuf();
1665 int set_a_break_pt_here = 9; 1667 int set_a_break_pt_here = 9;
1666 SwapBuf(); 1668 SwapBuf();
1667 #endif 1669 #endif
1668 #endif 1670 #endif
1669 } 1671 }
1670 1672
OLDNEW
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698