diff options
-rw-r--r-- | BUILD.gn | 15 | ||||
-rw-r--r-- | include/gpu/vk/GrVkBackendContext.h | 9 | ||||
-rw-r--r-- | src/gpu/vk/GrVkBackendContext.cpp | 5 |
3 files changed, 10 insertions, 19 deletions
@@ -41,7 +41,6 @@ declare_args() { skia_enable_tools = is_skia_dev_build skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug skia_vulkan_sdk = getenv("VULKAN_SDK") - skia_link_with_vulkan = !is_fuchsia } declare_args() { skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib @@ -167,15 +166,6 @@ config("skia_private") { lib_dirs += [ "$skia_vulkan_sdk/lib/" ] } } - - if (skia_link_with_vulkan) { - defines += [ "SK_LINK_WITH_VULKAN" ] - if (is_win) { - libs += [ "vulkan-1.lib" ] - } else { - libs += [ "vulkan" ] - } - } } if (skia_enable_gpu) { include_dirs += [ "src/gpu" ] @@ -911,6 +901,11 @@ if (skia_enable_tools) { } if (skia_use_vulkan) { sources += [ "tools/gpu/vk/VkTestContext.cpp" ] + if (is_win) { + libs += [ "vulkan-1.lib" ] + } else { + libs += [ "vulkan" ] + } } } } diff --git a/include/gpu/vk/GrVkBackendContext.h b/include/gpu/vk/GrVkBackendContext.h index 987b32f3b3..429319c31c 100644 --- a/include/gpu/vk/GrVkBackendContext.h +++ b/include/gpu/vk/GrVkBackendContext.h @@ -56,10 +56,8 @@ struct GrVkBackendContext : public SkRefCnt { /** * Helper function to create the Vulkan objects needed for a Vulkan-backed GrContext. - * If getProc is null, a default getProc will be constructed if we are statically linking - * against Vulkan. Note that this default behavior will be removed soon as well as the version - * that uses the unified "GetProc" instead of separate "GetInstanceProc" and "GetDeviceProc" - * functions. + * Note that the version that uses the unified "GetProc" instead of separate "GetInstanceProc" + * and "GetDeviceProc" functions will be removed. * * If presentQueueIndex is non-NULL, will try to set up presentQueue as part of device * creation using the platform-specific canPresent() function. @@ -75,6 +73,9 @@ struct GrVkBackendContext : public SkRefCnt { const GrVkInterface::GetDeviceProc& getDeviceProc, uint32_t* presentQueueIndex = nullptr, CanPresentFn canPresent = CanPresentFn()) { + if (!getInstanceProc || !getDeviceProc) { + return nullptr; + } auto getProc = [&getInstanceProc, &getDeviceProc](const char* proc_name, VkInstance instance, VkDevice device) { if (device != VK_NULL_HANDLE) { diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp index fea1947489..479d680f18 100644 --- a/src/gpu/vk/GrVkBackendContext.cpp +++ b/src/gpu/vk/GrVkBackendContext.cpp @@ -51,12 +51,7 @@ const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex CanPresentFn canPresent, GrVkInterface::GetProc getProc) { if (!getProc) { -#ifdef SK_LINK_WITH_VULKAN - return GrVkBackendContext::Create(vkGetInstanceProcAddr, vkGetDeviceProcAddr, - presentQueueIndexPtr, canPresent); -#else return nullptr; -#endif } SkASSERT(getProc); |