aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorJames Jones <james@lowfidelity.net>2016-08-18 23:41:19 +0100
committerMark Young <marky@lunarg.com>2016-09-02 08:59:25 -0600
commit4f1ab39a5a1e95e11003a35c2c0c775f7466a425 (patch)
tree50271edf609a02381ed75e8723c24606db2ab42e /loader
parent336bcdc05545502d3d1413d4b74fe9ffef82ffb5 (diff)
downloadusermoji-4f1ab39a5a1e95e11003a35c2c0c775f7466a425.tar.xz
Fix VK_NV_external_memory_capabilities support
-Need to init the instance function pointer -The function should gracefully fall back on drivers that don't support it. Change-Id: I15b0c68028c8f5ad3b07342e255dbb4c37bb6f0a
Diffstat (limited to 'loader')
-rw-r--r--loader/extensions.c22
-rw-r--r--loader/loader.c1
2 files changed, 17 insertions, 6 deletions
diff --git a/loader/extensions.c b/loader/extensions.c
index 17190a4b..e14ceb19 100644
--- a/loader/extensions.c
+++ b/loader/extensions.c
@@ -58,17 +58,27 @@ terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV(
VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
VkExternalMemoryHandleTypeFlagsNV externalHandleType,
VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) {
-
struct loader_physical_device *phys_dev =
(struct loader_physical_device *)physicalDevice;
struct loader_icd *icd = phys_dev->this_icd;
- assert(icd->GetPhysicalDeviceExternalImageFormatPropertiesNV &&
- "loader: null GetPhysicalDeviceExternalImageFormatPropertiesNV ICD "
- "pointer");
+ if (!icd->GetPhysicalDeviceExternalImageFormatPropertiesNV) {
+ if (externalHandleType) {
+ return VK_ERROR_FORMAT_NOT_SUPPORTED;
+ }
+
+ if (!icd->GetPhysicalDeviceImageFormatProperties) {
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+
+ pExternalImageFormatProperties->externalMemoryFeatures = 0;
+ pExternalImageFormatProperties->exportFromImportedHandleTypes = 0;
+ pExternalImageFormatProperties->compatibleHandleTypes = 0;
- if (!icd->GetPhysicalDeviceExternalImageFormatPropertiesNV)
- return VK_ERROR_INITIALIZATION_FAILED;
+ return icd->GetPhysicalDeviceImageFormatProperties(
+ phys_dev->phys_dev, format, type, tiling, usage, flags,
+ &pExternalImageFormatProperties->imageFormatProperties);
+ }
return icd->GetPhysicalDeviceExternalImageFormatPropertiesNV(
phys_dev->phys_dev, format, type, tiling, usage, flags,
diff --git a/loader/loader.c b/loader/loader.c
index a519e437..7f90ee48 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1651,6 +1651,7 @@ static bool loader_icd_init_entrys(struct loader_icd *icd, VkInstance inst,
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
LOOKUP_GIPA(GetPhysicalDeviceWaylandPresentationSupportKHR, false);
#endif
+ LOOKUP_GIPA(GetPhysicalDeviceExternalImageFormatPropertiesNV, false);
#undef LOOKUP_GIPA