Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: src/gpu/vk/GrVkInterface.cpp

Issue 1832613003: Revise layer, extension and feature setup for Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove extra def of ENABLE_VK_LAYERS Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkUtil.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkInterface.cpp
diff --git a/src/gpu/vk/GrVkInterface.cpp b/src/gpu/vk/GrVkInterface.cpp
index 4d445a498916955e38379e0cbc28deeb8378ed4c..a6ac8d62f14cb7f4bca0a274194896bdc09304ec 100644
--- a/src/gpu/vk/GrVkInterface.cpp
+++ b/src/gpu/vk/GrVkInterface.cpp
@@ -6,6 +6,7 @@
*/
#include "vk/GrVkInterface.h"
+#include "vk/GrVkBackendContext.h"
#include "vk/GrVkUtil.h"
GrVkInterface::GrVkInterface() {
@@ -15,23 +16,8 @@ GrVkInterface::GrVkInterface() {
#define GET_PROC_LOCAL(inst, F) PFN_vk ## F F = (PFN_vk ## F) vkGetInstanceProcAddr(inst, "vk" #F)
#define GET_DEV_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetDeviceProcAddr(device, "vk" #F)
-const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkPhysicalDevice physDev,
- VkDevice device) {
-
- GET_PROC_LOCAL(nullptr, EnumerateInstanceExtensionProperties);
- GET_PROC_LOCAL(instance, EnumerateDeviceExtensionProperties);
- GET_PROC_LOCAL(nullptr, EnumerateInstanceLayerProperties);
- GET_PROC_LOCAL(instance, EnumerateDeviceLayerProperties);
-
- GrVkExtensions extensions;
- if (!extensions.init(kGrVkMinimumVersion,
- physDev,
- EnumerateInstanceExtensionProperties,
- EnumerateDeviceExtensionProperties,
- EnumerateInstanceLayerProperties,
- EnumerateDeviceLayerProperties)) {
- return nullptr;
- }
+const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device,
+ uint32_t extensionFlags) {
GrVkInterface* interface = new GrVkInterface();
GrVkInterface::Functions* functions = &interface->fFunctions;
@@ -191,14 +177,12 @@ const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkPhysicalDevice p
GET_PROC(CreateDisplayPlaneSurfaceKHR);
GET_DEV_PROC(CreateSharedSwapchainsKHR);
- if (extensions.hasInstanceExtension(VK_EXT_DEBUG_REPORT_EXTENSION_NAME)) {
+ if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) {
GET_PROC(CreateDebugReportCallbackEXT);
GET_PROC(DebugReportMessageEXT);
GET_PROC(DestroyDebugReportCallbackEXT);
}
- interface->fExtensions.swap(&extensions);
-
return interface;
}
@@ -342,28 +326,32 @@ bool GrVkInterface::validate() const {
NULL == fFunctions.fCmdBeginRenderPass ||
NULL == fFunctions.fCmdNextSubpass ||
NULL == fFunctions.fCmdEndRenderPass ||
- NULL == fFunctions.fCmdExecuteCommands ||
- NULL == fFunctions.fDestroySurfaceKHR ||
- NULL == fFunctions.fGetPhysicalDeviceSurfaceSupportKHR ||
- NULL == fFunctions.fGetPhysicalDeviceSurfaceCapabilitiesKHR ||
- NULL == fFunctions.fGetPhysicalDeviceSurfaceFormatsKHR ||
- NULL == fFunctions.fGetPhysicalDeviceSurfacePresentModesKHR ||
- NULL == fFunctions.fCreateSwapchainKHR ||
- NULL == fFunctions.fDestroySwapchainKHR ||
- NULL == fFunctions.fGetSwapchainImagesKHR ||
- NULL == fFunctions.fAcquireNextImageKHR ||
- NULL == fFunctions.fQueuePresentKHR ||
- NULL == fFunctions.fGetPhysicalDeviceDisplayPropertiesKHR ||
- NULL == fFunctions.fGetPhysicalDeviceDisplayPlanePropertiesKHR ||
- NULL == fFunctions.fGetDisplayPlaneSupportedDisplaysKHR ||
- NULL == fFunctions.fGetDisplayModePropertiesKHR ||
- NULL == fFunctions.fCreateDisplayModeKHR ||
- NULL == fFunctions.fGetDisplayPlaneCapabilitiesKHR ||
- NULL == fFunctions.fCreateDisplayPlaneSurfaceKHR ||
- NULL == fFunctions.fCreateSharedSwapchainsKHR ||
- NULL == fFunctions.fCreateDebugReportCallbackEXT ||
- NULL == fFunctions.fDebugReportMessageEXT ||
- NULL == fFunctions.fDestroyDebugReportCallbackEXT) {
+ NULL == fFunctions.fCmdExecuteCommands
+#ifdef VK_CHECK_ALL_FUNCTIONS
+ // || NULL == fFunctions.fDestroySurfaceKHR ||
+ //NULL == fFunctions.fGetPhysicalDeviceSurfaceSupportKHR ||
+ //NULL == fFunctions.fGetPhysicalDeviceSurfaceCapabilitiesKHR ||
+ //NULL == fFunctions.fGetPhysicalDeviceSurfaceFormatsKHR ||
+ //NULL == fFunctions.fGetPhysicalDeviceSurfacePresentModesKHR ||
+ //NULL == fFunctions.fCreateSwapchainKHR ||
+ //NULL == fFunctions.fDestroySwapchainKHR ||
+ //NULL == fFunctions.fGetSwapchainImagesKHR ||
+ //NULL == fFunctions.fAcquireNextImageKHR ||
+ //NULL == fFunctions.fQueuePresentKHR ||
+ //NULL == fFunctions.fGetPhysicalDeviceDisplayPropertiesKHR ||
+ //NULL == fFunctions.fGetPhysicalDeviceDisplayPlanePropertiesKHR ||
+ //NULL == fFunctions.fGetDisplayPlaneSupportedDisplaysKHR ||
+ //NULL == fFunctions.fGetDisplayModePropertiesKHR ||
+ //NULL == fFunctions.fCreateDisplayModeKHR ||
+ //NULL == fFunctions.fGetDisplayPlaneCapabilitiesKHR ||
+ //NULL == fFunctions.fCreateDisplayPlaneSurfaceKHR ||
+ //NULL == fFunctions.fCreateSharedSwapchainsKHR ||
+ //NULL == fFunctions.fCreateDebugReportCallbackEXT ||
+ //NULL == fFunctions.fDebugReportMessageEXT ||
+ //NULL == fFunctions.fDestroyDebugReportCallbackEXT) {
+#else
+ ) {
+#endif
return false;
}
return true;
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698