Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

Commit

Permalink
loader: Added some missing function entry points to loader_icd_init_e…
Browse files Browse the repository at this point in the history
…ntrys.

KHR_surface, KHR_display extension functions were not exposed properly.
Specifically, added LOOKUP_GIPA entries for:

	* GetPhysicalDeviceDisplayPropertiesKHR
	* GetDisplayModePropertiesKHR
	* CreateDisplayPlaneSurfaceKHR
	* GetPhysicalDeviceDisplayPlanePropertiesKHR
	* GetDisplayPlaneSupportedDisplaysKHR
	* CreateDisplayModeKHR
	* GetDisplayPlaneCapabilitiesKHR
	* DestroySurfaceKHR

Added missing function declaration DestroySurfaceKHR in loader_icd
struct.

Checking if KHR_surface extension is enabled before proceeding in the
terminator_CreateDisplayPlaneSurfaceKHR definition.

Change-Id: I0599efddedc5064859ae1f4e52bdbbf8788d5c12
  • Loading branch information
Petros Bantolas authored and jon-lunarg committed Apr 14, 2016
1 parent ce62d9f commit 5ba5d5d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions loader/loader.c
Expand Up @@ -1457,6 +1457,14 @@ static bool loader_icd_init_entrys(struct loader_icd *icd, VkInstance inst,
LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilitiesKHR, false);
LOOKUP_GIPA(GetPhysicalDeviceSurfaceFormatsKHR, false);
LOOKUP_GIPA(GetPhysicalDeviceSurfacePresentModesKHR, false);
LOOKUP_GIPA(GetPhysicalDeviceDisplayPropertiesKHR, false);
LOOKUP_GIPA(GetDisplayModePropertiesKHR, false);
LOOKUP_GIPA(CreateDisplayPlaneSurfaceKHR, false);
LOOKUP_GIPA(GetPhysicalDeviceDisplayPlanePropertiesKHR, false);
LOOKUP_GIPA(GetDisplayPlaneSupportedDisplaysKHR, false);
LOOKUP_GIPA(CreateDisplayModeKHR, false);
LOOKUP_GIPA(GetDisplayPlaneCapabilitiesKHR, false);
LOOKUP_GIPA(DestroySurfaceKHR, false);
#ifdef VK_USE_PLATFORM_WIN32_KHR
LOOKUP_GIPA(GetPhysicalDeviceWin32PresentationSupportKHR, false);
#endif
Expand Down
2 changes: 2 additions & 0 deletions loader/loader.h
Expand Up @@ -259,6 +259,8 @@ struct loader_icd {
GetDisplayPlaneCapabilitiesKHR;
PFN_vkCreateDisplayPlaneSurfaceKHR
CreateDisplayPlaneSurfaceKHR;
PFN_vkDestroySurfaceKHR
DestroySurfaceKHR;
struct loader_icd *next;
};

Expand Down
7 changes: 7 additions & 0 deletions loader/wsi.c
Expand Up @@ -1410,6 +1410,13 @@ terminator_CreateDisplayPlaneSurfaceKHR(
struct loader_instance *inst = loader_get_instance(instance);
VkIcdSurfaceDisplay *pIcdSurface = NULL;

if (!inst->wsi_surface_enabled) {
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"VK_KHR_surface extension not enabled. "
"vkCreateDisplayPlaneSurfaceKHR not executed!\n");
return VK_SUCCESS;
}

pIcdSurface = loader_heap_alloc(inst, sizeof(VkIcdSurfaceDisplay),
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (pIcdSurface == NULL) {
Expand Down

0 comments on commit 5ba5d5d

Please sign in to comment.