threading: improve EnumerateDeviceExtensionProperties
Call down the next layer unless pLayerName is threading.
diff --git a/layers/threading.cpp b/layers/threading.cpp
index c5242c7..4bdc964 100644
--- a/layers/threading.cpp
+++ b/layers/threading.cpp
@@ -178,14 +178,15 @@
VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
const char *pLayerName, uint32_t *pCount,
VkExtensionProperties *pProperties) {
- if (pLayerName == NULL) {
- dispatch_key key = get_dispatch_key(physicalDevice);
- layer_data *my_data = get_my_data_ptr(key, layer_data_map);
- return my_data->instance_dispatch_table->EnumerateDeviceExtensionProperties(physicalDevice, NULL, pCount, pProperties);
- } else {
- // Threading layer does not have any device extensions
+ // Threading layer does not have any device extensions
+ if (pLayerName && !strcmp(pLayerName, layerProps.layerName))
return util_GetExtensionProperties(0, nullptr, pCount, pProperties);
- }
+
+ assert(physicalDevice);
+
+ dispatch_key key = get_dispatch_key(physicalDevice);
+ layer_data *my_data = get_my_data_ptr(key, layer_data_map);
+ return my_data->instance_dispatch_table->EnumerateDeviceExtensionProperties(physicalDevice, NULL, pCount, pProperties);
}
static inline PFN_vkVoidFunction layer_intercept_instance_proc(const char *name) {
@@ -370,7 +371,8 @@
VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
const char *pLayerName, uint32_t *pCount,
VkExtensionProperties *pProperties) {
- return threading::EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pCount, pProperties);
+ // the layer command handles VK_NULL_HANDLE just fine
+ return threading::EnumerateDeviceExtensionProperties(VK_NULL_HANDLE, pLayerName, pCount, pProperties);
}
VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice dev, const char *funcName) {