aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2016-07-05 16:41:50 -0600
committerMark Young <marky@lunarg.com>2016-07-21 13:24:20 -0600
commit1606eb9bdeb72ae5dc1640b66c3936b395936fcd (patch)
tree9d7665d282481e1199525d38ac2a7b730fb5f41e /layers/core_validation.cpp
parentbc452537e4b25603f69e81ca919e4a605b5b1b44 (diff)
downloadusermoji-1606eb9bdeb72ae5dc1640b66c3936b395936fcd.tar.xz
layers : gh682 move gipa dispatch table init
Move the GIPA setup of the dispatch tables for layers into the layer_init_device_dispatch_table call since we're already doing a majority of it there. This removes the need to separately setup the WSI extension entry-points. Additionally, memset the table to 0, just to make sure anything that gets added in the future is obvoiusly not set. Change-Id: I63c7c107cd9f7957e2766fdbeb8a06bc1ae0eda6
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 87b47b09..980b92ee 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -4038,21 +4038,13 @@ VKAPI_ATTR void VKAPI_CALL DestroyInstance(VkInstance instance, const VkAllocati
layer_data_map.erase(key);
}
-static void createDeviceRegisterExtensions(const VkDeviceCreateInfo *pCreateInfo, VkDevice device) {
+static void checkDeviceRegisterExtensions(const VkDeviceCreateInfo *pCreateInfo, VkDevice device) {
uint32_t i;
// TBD: Need any locking, in case this function is called at the same time
// by more than one thread?
layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
dev_data->device_extensions.wsi_enabled = false;
- VkLayerDispatchTable *pDisp = dev_data->device_dispatch_table;
- PFN_vkGetDeviceProcAddr gpa = pDisp->GetDeviceProcAddr;
- pDisp->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR)gpa(device, "vkCreateSwapchainKHR");
- pDisp->DestroySwapchainKHR = (PFN_vkDestroySwapchainKHR)gpa(device, "vkDestroySwapchainKHR");
- pDisp->GetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR)gpa(device, "vkGetSwapchainImagesKHR");
- pDisp->AcquireNextImageKHR = (PFN_vkAcquireNextImageKHR)gpa(device, "vkAcquireNextImageKHR");
- pDisp->QueuePresentKHR = (PFN_vkQueuePresentKHR)gpa(device, "vkQueuePresentKHR");
-
for (i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0)
dev_data->device_extensions.wsi_enabled = true;
@@ -4168,7 +4160,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice gpu, const VkDevice
my_device_data->device = *pDevice;
my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice);
- createDeviceRegisterExtensions(pCreateInfo, *pDevice);
+ checkDeviceRegisterExtensions(pCreateInfo, *pDevice);
// Get physical device limits for this device
my_instance_data->instance_dispatch_table->GetPhysicalDeviceProperties(gpu, &(my_device_data->phys_dev_properties.properties));
uint32_t count;