aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2015-06-21 22:55:02 +1200
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-24 15:38:03 -0600
commitf576a3edbd003797df3ca6995160e093f14c9f9d (patch)
tree995503307e3b555f0c3a608cbfa1f9ca7ecb999f /loader
parent52b161e51097b2e0322b130b85ca94336f56733a (diff)
downloadusermoji-f576a3edbd003797df3ca6995160e093f14c9f9d.tar.xz
vulkan.h: Remove vkGetFormatInfo, add features/limits (#12827, v125)
NOTES: 1/ Some layers impact from vkGetFormatInfo -> vkGetPhysicalDeviceFormatInfo; some checks are currently disabled in ParamChecker pending discussion on the best way to do this. Similar checks in Image layer implemented via additional layer_data member to link back from VkDevice -> VkPhysicalDevice. 2/ VkPhysicalDeviceFeatures, VkPhysicalDeviceLimits members all zero for now; also some further churn to be done to the contents of these structures. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Diffstat (limited to 'loader')
-rw-r--r--loader/gpa_helper.h8
-rw-r--r--loader/loader.c49
-rw-r--r--loader/loader.h17
-rw-r--r--loader/table_ops.h12
-rw-r--r--loader/trampoline.c58
5 files changed, 130 insertions, 14 deletions
diff --git a/loader/gpa_helper.h b/loader/gpa_helper.h
index 52afa9bd..fd300554 100644
--- a/loader/gpa_helper.h
+++ b/loader/gpa_helper.h
@@ -107,8 +107,6 @@ static inline void* globalGetProcAddr(const char *name)
return (void*) vkCreateQueryPool;
if (!strcmp(name, "GetQueryPoolResults"))
return (void*) vkGetQueryPoolResults;
- if (!strcmp(name, "GetFormatInfo"))
- return (void*) vkGetFormatInfo;
if (!strcmp(name, "CreateBuffer"))
return (void*) vkCreateBuffer;
if (!strcmp(name, "CreateBufferView"))
@@ -263,6 +261,12 @@ static inline void *loader_non_passthrough_gpa(const char *name)
return (void*) vkEnumeratePhysicalDevices;
if (!strcmp(name, "GetPhysicalDeviceInfo"))
return (void*) vkGetPhysicalDeviceInfo;
+ if (!strcmp(name, "GetPhysicalDeviceFeatures"))
+ return (void*) vkGetPhysicalDeviceFeatures;
+ if (!strcmp(name, "GetPhysicalDeviceFormatInfo"))
+ return (void*) vkGetPhysicalDeviceFormatInfo;
+ if (!strcmp(name, "GetPhysicalDeviceLimits"))
+ return (void*) vkGetPhysicalDeviceLimits;
if (!strcmp(name, "GetInstanceProcAddr"))
return (void*) vkGetInstanceProcAddr;
if (!strcmp(name, "GetDeviceProcAddr"))
diff --git a/loader/loader.c b/loader/loader.c
index 57956aef..e940ef62 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -88,6 +88,9 @@ const VkLayerInstanceDispatchTable instance_disp = {
.DestroyInstance = loader_DestroyInstance,
.EnumeratePhysicalDevices = loader_EnumeratePhysicalDevices,
.GetPhysicalDeviceInfo = loader_GetPhysicalDeviceInfo,
+ .GetPhysicalDeviceFeatures = loader_GetPhysicalDeviceFeatures,
+ .GetPhysicalDeviceFormatInfo = loader_GetPhysicalDeviceFormatInfo,
+ .GetPhysicalDeviceLimits = loader_GetPhysicalDeviceLimits,
.CreateDevice = loader_CreateDevice,
.GetPhysicalDeviceExtensionInfo = loader_GetPhysicalDeviceExtensionInfo,
.DbgCreateMsgCallback = loader_DbgCreateMsgCallback,
@@ -718,6 +721,9 @@ static void loader_icd_init_entrys(struct loader_icd *icd,
LOOKUP(DestroyInstance);
LOOKUP(EnumeratePhysicalDevices);
LOOKUP(GetPhysicalDeviceInfo);
+ LOOKUP(GetPhysicalDeviceFeatures);
+ LOOKUP(GetPhysicalDeviceFormatInfo);
+ LOOKUP(GetPhysicalDeviceLimits);
LOOKUP(CreateDevice);
LOOKUP(GetPhysicalDeviceExtensionInfo);
LOOKUP(DbgCreateMsgCallback);
@@ -1699,6 +1705,49 @@ VkResult loader_GetPhysicalDeviceInfo(
return res;
}
+VkResult loader_GetPhysicalDeviceFeatures(
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures* pFeatures)
+{
+ uint32_t gpu_index;
+ struct loader_icd *icd = loader_get_icd(physicalDevice, &gpu_index);
+ VkResult res = VK_ERROR_INITIALIZATION_FAILED;
+
+ if (icd->GetPhysicalDeviceFeatures)
+ res = icd->GetPhysicalDeviceFeatures(physicalDevice, pFeatures);
+
+ return res;
+}
+
+VkResult loader_GetPhysicalDeviceFormatInfo(
+ VkPhysicalDevice physicalDevice,
+ VkFormat format,
+ VkFormatProperties* pFormatInfo)
+{
+ uint32_t gpu_index;
+ struct loader_icd *icd = loader_get_icd(physicalDevice, &gpu_index);
+ VkResult res = VK_ERROR_INITIALIZATION_FAILED;
+
+ if (icd->GetPhysicalDeviceFormatInfo)
+ res = icd->GetPhysicalDeviceFormatInfo(physicalDevice, format, pFormatInfo);
+
+ return res;
+}
+
+VkResult loader_GetPhysicalDeviceLimits(
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceLimits* pLimits)
+{
+ uint32_t gpu_index;
+ struct loader_icd *icd = loader_get_icd(physicalDevice, &gpu_index);
+ VkResult res = VK_ERROR_INITIALIZATION_FAILED;
+
+ if (icd->GetPhysicalDeviceLimits)
+ res = icd->GetPhysicalDeviceLimits(physicalDevice, pLimits);
+
+ return res;
+}
+
VkResult loader_CreateDevice(
VkPhysicalDevice gpu,
const VkDeviceCreateInfo* pCreateInfo,
diff --git a/loader/loader.h b/loader/loader.h
index 72a21d4f..7019da8f 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -117,6 +117,9 @@ struct loader_icd {
PFN_vkDestroyInstance DestroyInstance;
PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
PFN_vkGetPhysicalDeviceInfo GetPhysicalDeviceInfo;
+ PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
+ PFN_vkGetPhysicalDeviceFormatInfo GetPhysicalDeviceFormatInfo;
+ PFN_vkGetPhysicalDeviceLimits GetPhysicalDeviceLimits;
PFN_vkCreateDevice CreateDevice;
PFN_vkGetPhysicalDeviceExtensionInfo GetPhysicalDeviceExtensionInfo;
PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback;
@@ -320,12 +323,26 @@ VkResult loader_EnumeratePhysicalDevices(
VkInstance instance,
uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices);
+
VkResult loader_GetPhysicalDeviceInfo(
VkPhysicalDevice gpu,
VkPhysicalDeviceInfoType infoType,
size_t* pDataSize,
void* pData);
+VkResult loader_GetPhysicalDeviceFeatures(
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures* pFeatures);
+
+VkResult loader_GetPhysicalDeviceFormatInfo(
+ VkPhysicalDevice physicalDevice,
+ VkFormat format,
+ VkFormatProperties* pFormatInfo);
+
+VkResult loader_GetPhysicalDeviceLimits(
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceLimits* pLimits);
+
VkResult loader_GetPhysicalDeviceExtensionInfo(
VkPhysicalDevice gpu,
VkExtensionInfoType infoType,
diff --git a/loader/table_ops.h b/loader/table_ops.h
index 360406a2..f1cbc22f 100644
--- a/loader/table_ops.h
+++ b/loader/table_ops.h
@@ -66,7 +66,6 @@ static inline void loader_init_device_dispatch_table(VkLayerDispatchTable *table
table->ResetEvent = (PFN_vkResetEvent) gpa(dev, "vkResetEvent");
table->CreateQueryPool = (PFN_vkCreateQueryPool) gpa(dev, "vkCreateQueryPool");
table->GetQueryPoolResults = (PFN_vkGetQueryPoolResults) gpa(dev, "vkGetQueryPoolResults");
- table->GetFormatInfo = (PFN_vkGetFormatInfo) gpa(dev, "vkGetFormatInfo");
table->CreateBuffer = (PFN_vkCreateBuffer) gpa(dev, "vkCreateBuffer");
table->CreateBufferView = (PFN_vkCreateBufferView) gpa(dev, "vkCreateBufferView");
table->CreateImage = (PFN_vkCreateImage) gpa(dev, "vkCreateImage");
@@ -210,8 +209,6 @@ static inline void *loader_lookup_device_dispatch_table(
return (void *) table->CreateQueryPool;
if (!strcmp(name, "GetQueryPoolResults"))
return (void *) table->GetQueryPoolResults;
- if (!strcmp(name, "GetFormatInfo"))
- return (void *) table->GetFormatInfo;
if (!strcmp(name, "CreateBuffer"))
return (void *) table->CreateBuffer;
if (!strcmp(name, "CreateBufferView"))
@@ -361,6 +358,9 @@ static inline void loader_init_instance_core_dispatch_table(VkLayerInstanceDispa
table->DestroyInstance = (PFN_vkDestroyInstance) gpa(inst, "vkDestroyInstance");
table->EnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices) gpa(inst, "vkEnumeratePhysicalDevices");
table->GetPhysicalDeviceInfo = (PFN_vkGetPhysicalDeviceInfo) gpa(inst, "vkGetPhysicalDeviceInfo");
+ table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures) gpa(inst, "vkGetPhysicalDeviceFeatures");
+ table->GetPhysicalDeviceFormatInfo = (PFN_vkGetPhysicalDeviceFormatInfo) gpa(inst, "vkGetPhysicalDeviceFormatInfo");
+ table->GetPhysicalDeviceLimits = (PFN_vkGetPhysicalDeviceLimits) gpa(inst, "vkGetPhysicalDeviceLimits");
table->CreateDevice = (PFN_vkCreateDevice) gpa(inst, "vkCreateDevice");
table->GetPhysicalDeviceExtensionInfo = (PFN_vkGetPhysicalDeviceExtensionInfo) gpa(inst, "vkGetPhysicalDeviceExtensionInfo");
}
@@ -390,6 +390,12 @@ static inline void *loader_lookup_instance_dispatch_table(
return (void *) table->EnumeratePhysicalDevices;
if (!strcmp(name, "GetPhysicalDeviceInfo"))
return (void *) table->GetPhysicalDeviceInfo;
+ if (!strcmp(name, "GetPhysicalDeviceFeatures"))
+ return (void *) table->GetPhysicalDeviceFeatures;
+ if (!strcmp(name, "GetPhysicalDeviceFormatInfo"))
+ return (void *) table->GetPhysicalDeviceFormatInfo;
+ if (!strcmp(name, "GetPhysicalDeviceLimits"))
+ return (void *) table->GetPhysicalDeviceLimits;
if (!strcmp(name, "GetInstanceProcAddr"))
return (void *) table->GetInstanceProcAddr;
if (!strcmp(name, "CreateDevice"))
diff --git a/loader/trampoline.c b/loader/trampoline.c
index c5eb01ad..0a1a1401 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -164,6 +164,55 @@ LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceInfo(
return res;
}
+LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
+ VkPhysicalDevice gpu,
+ VkPhysicalDeviceFeatures *pFeatures)
+{
+ const VkLayerInstanceDispatchTable *disp;
+ VkResult res;
+
+ disp = loader_get_instance_dispatch(gpu);
+
+ loader_platform_thread_lock_mutex(&loader_lock);
+ res = disp->GetPhysicalDeviceFeatures(gpu, pFeatures);
+ loader_platform_thread_unlock_mutex(&loader_lock);
+
+ return res;
+}
+
+LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatInfo(
+ VkPhysicalDevice gpu,
+ VkFormat format,
+ VkFormatProperties *pFormatInfo)
+{
+ const VkLayerInstanceDispatchTable *disp;
+ VkResult res;
+
+ disp = loader_get_instance_dispatch(gpu);
+
+ loader_platform_thread_lock_mutex(&loader_lock);
+ res = disp->GetPhysicalDeviceFormatInfo(gpu, format, pFormatInfo);
+ loader_platform_thread_unlock_mutex(&loader_lock);
+
+ return res;
+}
+
+LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits(
+ VkPhysicalDevice gpu,
+ VkPhysicalDeviceLimits *pLimits)
+{
+ const VkLayerInstanceDispatchTable *disp;
+ VkResult res;
+
+ disp = loader_get_instance_dispatch(gpu);
+
+ loader_platform_thread_lock_mutex(&loader_lock);
+ res = disp->GetPhysicalDeviceLimits(gpu, pLimits);
+ loader_platform_thread_unlock_mutex(&loader_lock);
+
+ return res;
+}
+
LOADER_EXPORT VkResult VKAPI vkCreateDevice(
VkPhysicalDevice gpu,
const VkDeviceCreateInfo* pCreateInfo,
@@ -468,15 +517,6 @@ LOADER_EXPORT VkResult VKAPI vkGetQueryPoolResults(VkDevice device, VkQueryPool
return disp->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags);
}
-LOADER_EXPORT VkResult VKAPI vkGetFormatInfo(VkDevice device, VkFormat format, VkFormatInfoType infoType, size_t* pDataSize, void* pData)
-{
- const VkLayerDispatchTable *disp;
-
- disp = loader_get_dispatch(device);
-
- return disp->GetFormatInfo(device, format, infoType, pDataSize, pData);
-}
-
LOADER_EXPORT VkResult VKAPI vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer)
{
const VkLayerDispatchTable *disp;