skia2/tools/gpu/vk/VkTestUtils.h
Emircan Uysaler 23ca4e7dc5 Enable creating protected vulkan backend
This CL allows user to indicate that they have a protected content in
GrVkBackendContext creation which results in protected CommandPool and Queue
usage.

Bug: skia:9016
Change-Id: I6a478d688b6988c2c5e5e98f18f58fb21f9d26ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210067
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Emircan Uysaler <emircan@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 16:04:00 +00:00

44 lines
1.3 KiB
C++

/*
* 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
#include "include/core/SkTypes.h"
#ifdef SK_VULKAN
#include "include/gpu/vk/GrVkBackendContext.h"
#include "include/gpu/vk/GrVkTypes.h"
#include "tools/gpu/vk/GrVulkanDefines.h"
#include <functional>
class GrVkExtensions;
struct GrVkBackendContext;
namespace sk_gpu_test {
bool LoadVkLibraryAndGetProcAddrFuncs(PFN_vkGetInstanceProcAddr*, PFN_vkGetDeviceProcAddr*);
using CanPresentFn = std::function<bool(VkInstance, VkPhysicalDevice,
uint32_t queueFamilyIndex)>;
bool CreateVkBackendContext(GrVkGetProc getProc,
GrVkBackendContext* ctx,
GrVkExtensions*,
VkPhysicalDeviceFeatures2*,
VkDebugReportCallbackEXT* debugCallback,
uint32_t* presentQueueIndexPtr = nullptr,
CanPresentFn canPresent = CanPresentFn(),
bool isProtected = false);
void FreeVulkanFeaturesStructs(const VkPhysicalDeviceFeatures2*);
}
#endif
#endif