Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread_safety: Split Device and Instance functionality #9246

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,8 @@ vvl_sources = [
"layers/vulkan/generated/sync_validation_types.cpp",
"layers/vulkan/generated/sync_validation_types.h",
"layers/vulkan/generated/thread_safety.cpp",
"layers/vulkan/generated/thread_safety_commands.h",
"layers/vulkan/generated/thread_safety_counter_bodies.h",
"layers/vulkan/generated/thread_safety_counter_definitions.h",
"layers/vulkan/generated/thread_safety_counter_instances.h",
"layers/vulkan/generated/thread_safety_device_defs.h",
"layers/vulkan/generated/thread_safety_instance_defs.h",
"layers/vulkan/generated/valid_enum_values.cpp",
"layers/vulkan/generated/valid_enum_values.h",
"layers/vulkan/generated/valid_flag_values.cpp",
Expand Down
6 changes: 2 additions & 4 deletions layers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,8 @@ target_sources(vvl PRIVATE
${API_TYPE}/generated/stateless_validation_helper.h
${API_TYPE}/generated/sync_validation_types.cpp
${API_TYPE}/generated/thread_safety.cpp
${API_TYPE}/generated/thread_safety_commands.h
${API_TYPE}/generated/thread_safety_counter_bodies.h
${API_TYPE}/generated/thread_safety_counter_definitions.h
${API_TYPE}/generated/thread_safety_counter_instances.h
${API_TYPE}/generated/thread_safety_device_defs.h
${API_TYPE}/generated/thread_safety_instance_defs.h
${API_TYPE}/generated/validation_cmd_copy_buffer_to_image_comp.h
${API_TYPE}/generated/validation_cmd_copy_buffer_to_image_comp.cpp
${API_TYPE}/generated/validation_cmd_dispatch_comp.h
Expand Down
360 changes: 179 additions & 181 deletions layers/thread_tracker/thread_safety_validation.cpp

Large diffs are not rendered by default.

232 changes: 95 additions & 137 deletions layers/thread_tracker/thread_safety_validation.h

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions layers/vulkan/generated/dispatch_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void Instance::InitValidationObjects() {
// Note that this DEFINES THE ORDER IN WHICH THE LAYER VALIDATION OBJECTS ARE CALLED

if (!settings.disabled[thread_safety]) {
object_dispatch.emplace_back(new ThreadSafety(this));
object_dispatch.emplace_back(new threadsafety::Instance(this));
}
if (!settings.disabled[stateless_checks]) {
object_dispatch.emplace_back(new StatelessValidation(this));
Expand All @@ -71,8 +71,8 @@ void Device::InitValidationObjects() {
// Note that this DEFINES THE ORDER IN WHICH THE LAYER VALIDATION OBJECTS ARE CALLED

if (!settings.disabled[thread_safety]) {
object_dispatch.emplace_back(
new ThreadSafety(this, static_cast<ThreadSafety*>(dispatch_instance->GetValidationObject(LayerObjectTypeThreading))));
object_dispatch.emplace_back(new threadsafety::Device(
this, static_cast<threadsafety::Instance*>(dispatch_instance->GetValidationObject(LayerObjectTypeThreading))));
}
if (!settings.disabled[stateless_checks]) {
object_dispatch.emplace_back(new StatelessValidation(
Expand Down
8 changes: 4 additions & 4 deletions layers/vulkan/generated/dispatch_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

/***************************************************************************
*
* Copyright (c) 2015-2024 The Khronos Group Inc.
* Copyright (c) 2015-2024 Valve Corporation
* Copyright (c) 2015-2024 LunarG, Inc.
* Copyright (c) 2015-2025 The Khronos Group Inc.
* Copyright (c) 2015-2025 Valve Corporation
* Copyright (c) 2015-2025 LunarG, Inc.
* Copyright (c) 2015-2024 Google Inc.
* Copyright (c) 2023-2024 RasterGrid Kft.
*
Expand Down Expand Up @@ -49,7 +49,7 @@ namespace dispatch {

void Device::InitObjectDispatchVectors() {
#define BUILD_DISPATCH_VECTOR(name) \
init_object_dispatch_vector(InterceptId##name, typeid(&ValidationObject::name), typeid(&ThreadSafety::name), \
init_object_dispatch_vector(InterceptId##name, typeid(&ValidationObject::name), typeid(&threadsafety::Device::name), \
typeid(&StatelessValidation::name), typeid(&ObjectLifetimes::name), typeid(&CoreChecks::name), \
typeid(&BestPractices::name), typeid(&gpuav::Validator::name), typeid(&SyncValidator::name));

Expand Down
6 changes: 3 additions & 3 deletions layers/vulkan/generated/dispatch_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

/***************************************************************************
*
* Copyright (c) 2015-2024 The Khronos Group Inc.
* Copyright (c) 2015-2024 Valve Corporation
* Copyright (c) 2015-2024 LunarG, Inc.
* Copyright (c) 2015-2025 The Khronos Group Inc.
* Copyright (c) 2015-2025 Valve Corporation
* Copyright (c) 2015-2025 LunarG, Inc.
* Copyright (c) 2015-2024 Google Inc.
* Copyright (c) 2023-2024 RasterGrid Kft.
*
Expand Down
26 changes: 13 additions & 13 deletions layers/vulkan/generated/feature_requirements_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4388,21 +4388,21 @@ FeatureAndName AddFeature(APIVersion api_version, vkt::Feature feature, void **i
}
#ifdef VK_ENABLE_BETA_EXTENSIONS

case Feature::constantAlphaColorBlendFactors : {
auto vk_struct = const_cast<VkPhysicalDevicePortabilitySubsetFeaturesKHR *>(
vku::FindStructInPNextChain<VkPhysicalDevicePortabilitySubsetFeaturesKHR>(*inout_pnext_chain));
if (!vk_struct) {
vk_struct = new VkPhysicalDevicePortabilitySubsetFeaturesKHR;
*vk_struct = vku::InitStructHelper();
if (*inout_pnext_chain) {
vvl::PnextChainAdd(*inout_pnext_chain, vk_struct);
} else {
*inout_pnext_chain = vk_struct;
}
case Feature::constantAlphaColorBlendFactors: {
auto vk_struct = const_cast<VkPhysicalDevicePortabilitySubsetFeaturesKHR *>(
vku::FindStructInPNextChain<VkPhysicalDevicePortabilitySubsetFeaturesKHR>(*inout_pnext_chain));
if (!vk_struct) {
vk_struct = new VkPhysicalDevicePortabilitySubsetFeaturesKHR;
*vk_struct = vku::InitStructHelper();
if (*inout_pnext_chain) {
vvl::PnextChainAdd(*inout_pnext_chain, vk_struct);
} else {
*inout_pnext_chain = vk_struct;
}
return {&vk_struct->constantAlphaColorBlendFactors,
"VkPhysicalDevicePortabilitySubsetFeaturesKHR::constantAlphaColorBlendFactors"};
}
return {&vk_struct->constantAlphaColorBlendFactors,
"VkPhysicalDevicePortabilitySubsetFeaturesKHR::constantAlphaColorBlendFactors"};
}
#endif // VK_ENABLE_BETA_EXTENSIONS
#ifdef VK_ENABLE_BETA_EXTENSIONS

Expand Down
Loading
Loading