diff options
author | Greg Daniel <egdaniel@google.com> | 2018-07-12 10:02:37 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-12 14:35:08 +0000 |
commit | c8cd45aaf43c5d044d8433d38c8332b1679eeadb (patch) | |
tree | 065475875fe983972a8a704ae340aa45bbe0150c /tools/gpu/vk/VkTestUtils.cpp | |
parent | 77c138f2cd41cbb0e43985bb458f21455fead646 (diff) |
Generate GrVkInterface when we make the GrVkGpu.
Also add a GetProc function to the GrVkBackendContext which will be used
to create the GrVkInterface.
This change (and updating clients to use it), will allow us to move GrVkInterface
out of public which is needed to fix vulkan header issues.
Bug: skia:
Change-Id: Id8067943ae27cec8cad29fd31b05f0b8387412d4
Reviewed-on: https://skia-review.googlesource.com/140783
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/gpu/vk/VkTestUtils.cpp')
-rw-r--r-- | tools/gpu/vk/VkTestUtils.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tools/gpu/vk/VkTestUtils.cpp b/tools/gpu/vk/VkTestUtils.cpp index e6ddda2fce..017d767dc5 100644 --- a/tools/gpu/vk/VkTestUtils.cpp +++ b/tools/gpu/vk/VkTestUtils.cpp @@ -138,8 +138,8 @@ bool CreateVkBackendContext(const GrVkInterface::GetInstanceProc& getInstancePro VkDebugReportCallbackEXT* debugCallback, uint32_t* presentQueueIndexPtr, CanPresentFn canPresent) { - auto getProc = [&getInstanceProc, &getDeviceProc](const char* proc_name, - VkInstance instance, VkDevice device) { + auto getProc = [getInstanceProc, getDeviceProc](const char* proc_name, + VkInstance instance, VkDevice device) { if (device != VK_NULL_HANDLE) { return getDeviceProc(device, proc_name); } @@ -406,16 +406,6 @@ bool CreateVkBackendContext(const GrVkInterface::GetInstanceProc& getInstancePro return false; } - auto interface = - sk_make_sp<GrVkInterface>(getProc, inst, device, extensionFlags); - if (!interface->validate(extensionFlags)) { - SkDebugf("Vulkan interface validation failed\n"); - grVkDeviceWaitIdle(device); - grVkDestroyDevice(device, nullptr); - destroy_instance(getProc, inst, debugCallback, hasDebugExtension); - return false; - } - VkQueue queue; grVkGetDeviceQueue(device, graphicsQueueIndex, 0, &queue); @@ -427,7 +417,8 @@ bool CreateVkBackendContext(const GrVkInterface::GetInstanceProc& getInstancePro ctx->fMinAPIVersion = kGrVkMinimumVersion; ctx->fExtensions = extensionFlags; ctx->fFeatures = featureFlags; - ctx->fInterface.reset(interface.release()); + ctx->fInterface = nullptr; + ctx->fGetProc = getProc; ctx->fOwnsInstanceAndDevice = false; return true; |