diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2017-01-26 15:23:11 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-01-31 09:55:10 -0700 |
| commit | af006f57700efaab33e4fd2fe50a8017b3e25c01 (patch) | |
| tree | 0e1d67e82382e1f43ed69a20d8b30832c182da17 /layers/core_validation.cpp | |
| parent | 0e555ea29c5306a6ce085eb14dcbac605a0e7265 (diff) | |
| download | usermoji-af006f57700efaab33e4fd2fe50a8017b3e25c01.tar.xz | |
layers: Move CreateImage validation into core_val
Was in Image layer. Added layer_data accessor functions.
Change-Id: I55b7896cfc9de81210c9fba4d332998c827f5d44
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index d342afa5..4d1e30e1 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -6394,12 +6394,31 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateBufferView(VkDevice device, const VkBufferV return result; } +// Access helper functions for external modules +PFN_vkGetPhysicalDeviceFormatProperties GetFormatPropertiesPointer(core_validation::layer_data *device_data) { + return device_data->instance_data->dispatch_table.GetPhysicalDeviceFormatProperties; +} + +PFN_vkGetPhysicalDeviceImageFormatProperties GetImageFormatPropertiesPointer(core_validation::layer_data *device_data) { + return device_data->instance_data->dispatch_table.GetPhysicalDeviceImageFormatProperties; +} + +VkPhysicalDevice GetPhysicalDevice(core_validation::layer_data *device_data) { return device_data->physical_device; } + +const debug_report_data *GetReportData(core_validation::layer_data *device_data) { return device_data->report_data; } + +const VkPhysicalDeviceProperties *GetPhysicalDeviceProperties(core_validation::layer_data *device_data) { + return &device_data->phys_dev_props; +} + VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage) { + VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); - - VkResult result = dev_data->dispatch_table.CreateImage(device, pCreateInfo, pAllocator, pImage); - + bool skip = PreCallValidateCreateImage(dev_data, pCreateInfo, pAllocator, pImage); + if (!skip) { + result = dev_data->dispatch_table.CreateImage(device, pCreateInfo, pAllocator, pImage); + } if (VK_SUCCESS == result) { std::lock_guard<std::mutex> lock(global_lock); PostCallRecordCreateImage(&dev_data->imageMap, &dev_data->imageSubresourceMap, &dev_data->imageLayoutMap, pCreateInfo, |
