aboutsummaryrefslogtreecommitdiff
path: root/layers/swapchain.cpp
diff options
context:
space:
mode:
authorChia-I Wu <olv@google.com>2016-04-28 14:21:13 +0800
committerChia-I Wu <olv@google.com>2016-05-13 10:35:37 +0800
commit1695c66fd68e3607d07e44c891328d7bb4292842 (patch)
tree55c18c9193316a8ea8a4cd1bf95c1758976fede5 /layers/swapchain.cpp
parente97edbc54ac3e33adc33a13da51c8c07f91ff074 (diff)
downloadusermoji-1695c66fd68e3607d07e44c891328d7bb4292842.tar.xz
swapchain: improve EnumerateDeviceExtensionProperties
Call down the next layer unless pLayerName is swapchain.
Diffstat (limited to 'layers/swapchain.cpp')
-rw-r--r--layers/swapchain.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index f14cdaa0..bcdf151b 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -2123,13 +2123,14 @@ DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugR
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 {
+ if (pLayerName && !strcmp(pLayerName, swapchain_layer.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);
}
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, const char *funcName) {
@@ -2292,7 +2293,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 swapchain::EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pCount, pProperties);
+ // the layer command handles VK_NULL_HANDLE just fine
+ return swapchain::EnumerateDeviceExtensionProperties(VK_NULL_HANDLE, pLayerName, pCount, pProperties);
}
VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice dev, const char *funcName) {