From b9ee8f56b0b28209fe574641bf3f10d3b9fb402d Mon Sep 17 00:00:00 2001 From: ziga-lunarg Date: Wed, 4 Sep 2024 23:47:17 +0200 Subject: [PATCH] shaderObject: Fix object name crash --- .../generated/shader_object_constants.h | 2 +- ...er_object_create_device_feature_structs.inl | 2 +- ...device_data_declare_extension_variables.inl | 2 +- ...object_device_data_dynamic_state_adding.inl | 2 +- ...ect_device_data_set_extension_variables.inl | 2 +- .../shader_object_entry_points_x_macros.inl | 6 ++++-- ...ercepted_dynamic_state_function_by_name.inl | 2 +- ...r_object_full_draw_state_struct_members.cpp | 2 +- ...r_object_full_draw_state_struct_members.inl | 2 +- ...bject_full_draw_state_utility_functions.inl | 2 +- layers/shader_object/shader_object.cpp | 18 ++++++++++++++++++ scripts/shader_object_data.json | 6 ++++++ scripts/shader_object_generator.py | 4 ++-- 13 files changed, 39 insertions(+), 13 deletions(-) diff --git a/layers/shader_object/generated/shader_object_constants.h b/layers/shader_object/generated/shader_object_constants.h index 8e85126e..f3a7b1e5 100644 --- a/layers/shader_object/generated/shader_object_constants.h +++ b/layers/shader_object/generated/shader_object_constants.h @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/generated/shader_object_create_device_feature_structs.inl b/layers/shader_object/generated/shader_object_create_device_feature_structs.inl index 7504aa48..fff7e2d8 100644 --- a/layers/shader_object/generated/shader_object_create_device_feature_structs.inl +++ b/layers/shader_object/generated/shader_object_create_device_feature_structs.inl @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/generated/shader_object_device_data_declare_extension_variables.inl b/layers/shader_object/generated/shader_object_device_data_declare_extension_variables.inl index 532b8425..b5cb5b8f 100644 --- a/layers/shader_object/generated/shader_object_device_data_declare_extension_variables.inl +++ b/layers/shader_object/generated/shader_object_device_data_declare_extension_variables.inl @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/generated/shader_object_device_data_dynamic_state_adding.inl b/layers/shader_object/generated/shader_object_device_data_dynamic_state_adding.inl index fb5ffeb7..7097980f 100644 --- a/layers/shader_object/generated/shader_object_device_data_dynamic_state_adding.inl +++ b/layers/shader_object/generated/shader_object_device_data_dynamic_state_adding.inl @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/generated/shader_object_device_data_set_extension_variables.inl b/layers/shader_object/generated/shader_object_device_data_set_extension_variables.inl index 2eeda858..7a8c6d7f 100644 --- a/layers/shader_object/generated/shader_object_device_data_set_extension_variables.inl +++ b/layers/shader_object/generated/shader_object_device_data_set_extension_variables.inl @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/generated/shader_object_entry_points_x_macros.inl b/layers/shader_object/generated/shader_object_entry_points_x_macros.inl index 45b713a9..3a832a5c 100644 --- a/layers/shader_object/generated/shader_object_entry_points_x_macros.inl +++ b/layers/shader_object/generated/shader_object_entry_points_x_macros.inl @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -130,7 +130,9 @@ ENTRY_POINT(CreateDescriptorUpdateTemplate)\ ENTRY_POINT_ALIAS(CreateDescriptorUpdateTemplateKHR, CreateDescriptorUpdateTemplate)\ ENTRY_POINT(DestroyDescriptorUpdateTemplate)\ - ENTRY_POINT_ALIAS(DestroyDescriptorUpdateTemplateKHR, DestroyDescriptorUpdateTemplate) + ENTRY_POINT_ALIAS(DestroyDescriptorUpdateTemplateKHR, DestroyDescriptorUpdateTemplate)\ + ENTRY_POINT(SetDebugUtilsObjectNameEXT)\ + ENTRY_POINT(SetDebugUtilsObjectTagEXT) #define ADDITIONAL_INSTANCE_FUNCTIONS\ ENTRY_POINT(GetPhysicalDeviceProperties)\ diff --git a/layers/shader_object/generated/shader_object_find_intercepted_dynamic_state_function_by_name.inl b/layers/shader_object/generated/shader_object_find_intercepted_dynamic_state_function_by_name.inl index bfebb562..ad90e827 100644 --- a/layers/shader_object/generated/shader_object_find_intercepted_dynamic_state_function_by_name.inl +++ b/layers/shader_object/generated/shader_object_find_intercepted_dynamic_state_function_by_name.inl @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/generated/shader_object_full_draw_state_struct_members.cpp b/layers/shader_object/generated/shader_object_full_draw_state_struct_members.cpp index 922fda20..13b82412 100644 --- a/layers/shader_object/generated/shader_object_full_draw_state_struct_members.cpp +++ b/layers/shader_object/generated/shader_object_full_draw_state_struct_members.cpp @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/generated/shader_object_full_draw_state_struct_members.inl b/layers/shader_object/generated/shader_object_full_draw_state_struct_members.inl index 31de8aa5..39eb2ad4 100644 --- a/layers/shader_object/generated/shader_object_full_draw_state_struct_members.inl +++ b/layers/shader_object/generated/shader_object_full_draw_state_struct_members.inl @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/generated/shader_object_full_draw_state_utility_functions.inl b/layers/shader_object/generated/shader_object_full_draw_state_utility_functions.inl index d149b3a5..994daddc 100644 --- a/layers/shader_object/generated/shader_object_full_draw_state_utility_functions.inl +++ b/layers/shader_object/generated/shader_object_full_draw_state_utility_functions.inl @@ -2,7 +2,7 @@ // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/layers/shader_object/shader_object.cpp b/layers/shader_object/shader_object.cpp index 3042b354..3403aa21 100644 --- a/layers/shader_object/shader_object.cpp +++ b/layers/shader_object/shader_object.cpp @@ -3165,6 +3165,24 @@ static VKAPI_ATTR void DestroyDescriptorUpdateTemplate(VkDevice device, VkDescri RemoveDescriptorUpdateTemplateBindPoint(device_data, descriptorUpdateTemplate); } +static VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo) { + DeviceData& data = *device_data_map.Get(device); + VkResult result = VK_SUCCESS; + if (pNameInfo && pNameInfo->objectType != VK_OBJECT_TYPE_SHADER_EXT) { + result = data.vtable.SetDebugUtilsObjectNameEXT(device, pNameInfo); + } + return result; +} + +static VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo) { + DeviceData& data = *device_data_map.Get(device); + VkResult result = VK_SUCCESS; + if (pTagInfo && pTagInfo->objectType != VK_OBJECT_TYPE_SHADER_EXT) { + result = data.vtable.SetDebugUtilsObjectTagEXT(device, pTagInfo); + } + return result; +} + static VKAPI_ATTR void VKAPI_CALL FakeCmdSetColorBlendAdvancedEXT(VkCommandBuffer, uint32_t, uint32_t, const VkColorBlendAdvancedEXT*) {} // Get Proc Addr diff --git a/scripts/shader_object_data.json b/scripts/shader_object_data.json index e0e61732..39ebd90c 100644 --- a/scripts/shader_object_data.json +++ b/scripts/shader_object_data.json @@ -1224,6 +1224,12 @@ [ "DestroyDescriptorUpdateTemplate", "DestroyDescriptorUpdateTemplateKHR" + ], + [ + "SetDebugUtilsObjectNameEXT" + ], + [ + "SetDebugUtilsObjectTagEXT" ] ] }, diff --git a/scripts/shader_object_generator.py b/scripts/shader_object_generator.py index c4539877..0183bddd 100644 --- a/scripts/shader_object_generator.py +++ b/scripts/shader_object_generator.py @@ -1,4 +1,4 @@ -# Copyright 2023 Nintendo +# Copyright 2023-2024 Nintendo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ def create_generated_file(filename): // See shader_object_generator.py for modifications /* - * Copyright 2023 Nintendo + * Copyright 2023-2024 Nintendo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.