diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-12-01 09:37:56 -0700 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-12-02 11:35:37 -0700 |
| commit | cb35cef6cbe50805c30fec7dceae8db911d4447f (patch) | |
| tree | fad36b8df14b84119f47b93ed322b79c745e0f17 /layers/parameter_validation.cpp | |
| parent | 42ed85bcd0112ebc866562049f5ee71e8cd5395b (diff) | |
| download | usermoji-cb35cef6cbe50805c30fec7dceae8db911d4447f.tar.xz | |
layers:Handle NULL DebugMarker function ptrs
Fixes #1074
Object_tracker and parameter_checker intercept DebugMarker extension
functions which may not be supported by underlying device and
therefore could terminate with a NULL function call.
Updating these layers to handle this case by making sure that their
downstream function ptr is not null before calling down the chain.
If the downstream function ptr is null, considering that VK_SUCCESS
in the layers for functions with VkResult return code.
Diffstat (limited to 'layers/parameter_validation.cpp')
| -rw-r--r-- | layers/parameter_validation.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index c5c6179c..b76a5815 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -5421,9 +5421,12 @@ VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(VkDevice device, VkDeb skip |= parameter_validation_vkDebugMarkerSetObjectTagEXT(my_data->report_data, pTagInfo); if (!skip) { - result = my_data->dispatch_table.DebugMarkerSetObjectTagEXT(device, pTagInfo); - - validate_result(my_data->report_data, "vkDebugMarkerSetObjectTagEXT", result); + if (my_data->dispatch_table.DebugMarkerSetObjectTagEXT) { + result = my_data->dispatch_table.DebugMarkerSetObjectTagEXT(device, pTagInfo); + validate_result(my_data->report_data, "vkDebugMarkerSetObjectTagEXT", result); + } else { + result = VK_SUCCESS; + } } return result; @@ -5438,9 +5441,12 @@ VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, VkDe skip |= parameter_validation_vkDebugMarkerSetObjectNameEXT(my_data->report_data, pNameInfo); if (!skip) { - VkResult result = my_data->dispatch_table.DebugMarkerSetObjectNameEXT(device, pNameInfo); - - validate_result(my_data->report_data, "vkDebugMarkerSetObjectNameEXT", result); + if (my_data->dispatch_table.DebugMarkerSetObjectNameEXT) { + result = my_data->dispatch_table.DebugMarkerSetObjectNameEXT(device, pNameInfo); + validate_result(my_data->report_data, "vkDebugMarkerSetObjectNameEXT", result); + } else { + result = VK_SUCCESS; + } } return result; @@ -5453,7 +5459,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, skip |= parameter_validation_vkCmdDebugMarkerBeginEXT(my_data->report_data, pMarkerInfo); - if (!skip) { + if (!skip && my_data->dispatch_table.CmdDebugMarkerBeginEXT) { my_data->dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); } } @@ -5465,7 +5471,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer skip |= parameter_validation_vkCmdDebugMarkerInsertEXT(my_data->report_data, pMarkerInfo); - if (!skip) { + if (!skip && my_data->dispatch_table.CmdDebugMarkerInsertEXT) { my_data->dispatch_table.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo); } } |
