aboutsummaryrefslogtreecommitdiff
path: root/layers/threading.cpp
diff options
context:
space:
mode:
authorChia-I Wu <olv@google.com>2016-05-16 10:16:30 +0800
committerTobin Ehlis <tobine@google.com>2016-05-24 06:29:14 -0600
commitd8e985d3053398368a7d44d632274b2db7ea6cc8 (patch)
tree34519369a9dadfead6a1c36f2299ad4cbe5e819b /layers/threading.cpp
parent139ff88b3235317624a6ca2a1f5243ef798703c7 (diff)
downloadusermoji-d8e985d3053398368a7d44d632274b2db7ea6cc8.tar.xz
threading: improve EnumerateDeviceExtensionProperties
Call down the next layer unless pLayerName is threading.
Diffstat (limited to 'layers/threading.cpp')
-rw-r--r--layers/threading.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/layers/threading.cpp b/layers/threading.cpp
index c5242c73..4bdc9644 100644
--- a/layers/threading.cpp
+++ b/layers/threading.cpp
@@ -178,14 +178,15 @@ static inline PFN_vkVoidFunction layer_intercept_proc(const char *name) {
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 @@ vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCou
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) {