Minor fixes to avoid NVPR in Vulkan and provide good GrVkGpu teardown.

BUG=skia:5097
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818093002

Review URL: https://codereview.chromium.org/1818093002
This commit is contained in:
jvanverth 2016-03-21 11:46:00 -07:00 committed by Commit bot
parent fa4c20e728
commit ddf9835e9c
2 changed files with 9 additions and 3 deletions

View File

@ -129,7 +129,11 @@ GrContextFactory::ContextInfo GrContextFactory::getContextInfo(GLContextType typ
glCtx->makeCurrent();
GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glInterface.get());
#ifdef SK_VULKAN
grCtx.reset(GrContext::Create(kVulkan_GrBackend, p3dctx, fGlobalOptions));
if (kEnableNVPR_GLContextOptions & options) {
return ContextInfo();
} else {
grCtx.reset(GrContext::Create(kVulkan_GrBackend, p3dctx, fGlobalOptions));
}
#else
grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions));
#endif

View File

@ -356,9 +356,11 @@ GrVkGpu::~GrVkGpu() {
fCurrentCmdBuffer->unref(this);
// wait for all commands to finish
fResourceProvider.checkCommandBuffers();
VkResult res = VK_CALL(QueueWaitIdle(fQueue));
SkASSERT(res == VK_SUCCESS);
// VK_ERROR_DEVICE_LOST is acceptable when tearing down (see 4.2.4 in spec)
SkASSERT(VK_SUCCESS == res || VK_ERROR_DEVICE_LOST == res);
// must call this just before we destroy the VkDevice
fResourceProvider.destroyResources();