Skip to content

Commit

Permalink
shaderObject: Fix object name crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg committed Sep 5, 2024
1 parent 6d60024 commit b9ee8f5
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion layers/shader_object/generated/shader_object_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 18 additions & 0 deletions layers/shader_object/shader_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions scripts/shader_object_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,12 @@
[
"DestroyDescriptorUpdateTemplate",
"DestroyDescriptorUpdateTemplateKHR"
],
[
"SetDebugUtilsObjectNameEXT"
],
[
"SetDebugUtilsObjectTagEXT"
]
]
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/shader_object_generator.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit b9ee8f5

Please sign in to comment.