2017-11-10 15:03:05 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VkTestUtils_DEFINED
|
|
|
|
#define VkTestUtils_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkTypes.h"
|
2017-11-10 20:55:14 +00:00
|
|
|
|
2017-11-10 15:03:05 +00:00
|
|
|
#ifdef SK_VULKAN
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/gpu/vk/GrVkBackendContext.h"
|
|
|
|
#include "include/gpu/vk/GrVkTypes.h"
|
|
|
|
#include "tools/gpu/vk/GrVulkanDefines.h"
|
2018-08-01 13:19:45 +00:00
|
|
|
#include <functional>
|
2018-07-02 20:15:37 +00:00
|
|
|
|
2018-08-01 17:25:41 +00:00
|
|
|
class GrVkExtensions;
|
2018-07-02 20:15:37 +00:00
|
|
|
struct GrVkBackendContext;
|
2017-11-10 15:03:05 +00:00
|
|
|
|
|
|
|
namespace sk_gpu_test {
|
|
|
|
bool LoadVkLibraryAndGetProcAddrFuncs(PFN_vkGetInstanceProcAddr*, PFN_vkGetDeviceProcAddr*);
|
2018-07-02 20:15:37 +00:00
|
|
|
|
|
|
|
using CanPresentFn = std::function<bool(VkInstance, VkPhysicalDevice,
|
|
|
|
uint32_t queueFamilyIndex)>;
|
|
|
|
|
2018-08-01 13:19:45 +00:00
|
|
|
bool CreateVkBackendContext(GrVkGetProc getProc,
|
2018-07-02 20:15:37 +00:00
|
|
|
GrVkBackendContext* ctx,
|
2018-08-01 17:25:41 +00:00
|
|
|
GrVkExtensions*,
|
2018-08-08 13:23:18 +00:00
|
|
|
VkPhysicalDeviceFeatures2*,
|
2018-07-02 20:16:44 +00:00
|
|
|
VkDebugReportCallbackEXT* debugCallback,
|
2018-07-02 20:15:37 +00:00
|
|
|
uint32_t* presentQueueIndexPtr = nullptr,
|
2019-06-24 14:53:09 +00:00
|
|
|
CanPresentFn canPresent = CanPresentFn(),
|
|
|
|
bool isProtected = false);
|
2018-08-08 13:23:18 +00:00
|
|
|
|
|
|
|
void FreeVulkanFeaturesStructs(const VkPhysicalDeviceFeatures2*);
|
2020-08-06 18:11:56 +00:00
|
|
|
} // namespace sk_gpu_test
|
2017-11-10 15:03:05 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|