aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkInterface.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-06-28 20:18:59 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-28 20:50:17 +0000
commita782dcb3c407a7e30d7c1263bf9965792088e786 (patch)
tree516d027239462f6b5f8cc56a4731f0e5e195c6d3 /src/gpu/vk/GrVkInterface.cpp
parent2b3808eda2e5ce82b33c17a9e04f1f0fa441e397 (diff)
Reland "Let client pass in full extension to GrVkBackendContext."
This reverts commit cb92b26e5ca6063bcf1a922109b8224e0b6eb4da. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Let client pass in full extension to GrVkBackendContext." > > This reverts commit 45c9dab4c3ec43cedb28d1b8c08e166fe0c2e767. > > Reason for revert: fucshia uses GrVkBackendContext. Need to revert earlier changes > > Original change's description: > > Let client pass in full extension to GrVkBackendContext. > > > > Bug: skia: > > Change-Id: I772ab4ccbca0f4f7e7d429d6c421b07d97f0606f > > Reviewed-on: https://skia-review.googlesource.com/131880 > > Reviewed-by: Jim Van Verth <jvanverth@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com > > Change-Id: I1a765ff406c83cb234c3614b804fbed677d5a382 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/137901 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: I0af797c51dde705473e9afaccb1d4b4423e8c41e Reviewed-on: https://skia-review.googlesource.com/138302 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/vk/GrVkInterface.cpp')
-rw-r--r--src/gpu/vk/GrVkInterface.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/gpu/vk/GrVkInterface.cpp b/src/gpu/vk/GrVkInterface.cpp
index dedc264136..c8f33711e0 100644
--- a/src/gpu/vk/GrVkInterface.cpp
+++ b/src/gpu/vk/GrVkInterface.cpp
@@ -22,20 +22,27 @@ GrVkInterface::GetProc make_unified_getter(const GrVkInterface::GetInstanceProc&
};
}
-GrVkInterface::GrVkInterface(const GetInstanceProc& getInstanceProc,
- const GetDeviceProc& getDeviceProc,
+GrVkInterface::GrVkInterface(GetProc getProc,
VkInstance instance,
VkDevice device,
uint32_t extensionFlags)
- : GrVkInterface(make_unified_getter(getInstanceProc, getDeviceProc),
- instance,
- device,
- extensionFlags) {}
+ : fExtensions(extensionFlags) {
+ this->init(getProc, instance, device);
+}
GrVkInterface::GrVkInterface(GetProc getProc,
VkInstance instance,
VkDevice device,
- uint32_t extensionFlags) {
+ uint32_t instanceExtensionCount,
+ const char* const* instanceExtensions,
+ uint32_t deviceExtensionCount,
+ const char* const* deviceExtensions)
+ : fExtensions(instanceExtensionCount, instanceExtensions, deviceExtensionCount,
+ deviceExtensions) {
+ this->init(getProc, instance, device);
+}
+
+void GrVkInterface::init(GetProc getProc, VkInstance instance, VkDevice device) {
if (getProc == nullptr) {
return;
}
@@ -59,7 +66,7 @@ GrVkInterface::GrVkInterface(GetProc getProc,
ACQUIRE_PROC(EnumerateDeviceExtensionProperties, instance, VK_NULL_HANDLE);
ACQUIRE_PROC(EnumerateDeviceLayerProperties, instance, VK_NULL_HANDLE);
- if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) {
+ if (fExtensions.hasExtension(VK_EXT_DEBUG_REPORT_EXTENSION_NAME)) {
// Also instance Procs.
ACQUIRE_PROC(CreateDebugReportCallbackEXT, instance, VK_NULL_HANDLE);
ACQUIRE_PROC(DebugReportMessageEXT, instance, VK_NULL_HANDLE);
@@ -198,7 +205,7 @@ GrVkInterface::GrVkInterface(GetProc getProc,
if (kIsDebug) { SkDebugf("%s:%d GrVkInterface::validate() failed.\n", __FILE__, __LINE__); } \
return false;
-bool GrVkInterface::validate(uint32_t extensionFlags) const {
+bool GrVkInterface::validate() const {
// functions that are always required
if (nullptr == fFunctions.fCreateInstance ||
nullptr == fFunctions.fDestroyInstance ||
@@ -338,7 +345,7 @@ bool GrVkInterface::validate(uint32_t extensionFlags) const {
RETURN_FALSE_INTERFACE
}
- if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) {
+ if (fExtensions.hasExtension(VK_EXT_DEBUG_REPORT_EXTENSION_NAME)) {
if (nullptr == fFunctions.fCreateDebugReportCallbackEXT ||
nullptr == fFunctions.fDebugReportMessageEXT ||
nullptr == fFunctions.fDestroyDebugReportCallbackEXT) {