Skip to content

Commit a9f2052

Browse files
committed
build: Downstream Vulkan-ValidationLayers 1.4.330
2 parents 7fcd954 + a6b9cc1 commit a9f2052

File tree

842 files changed

+168826
-100222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

842 files changed

+168826
-100222
lines changed

.github/workflows/sdk_android_build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ jobs:
5757
abi: [ armeabi-v7a, arm64-v8a, x86, x86_64 ]
5858
steps:
5959
- name: Clone repository
60-
uses: actions/checkout@v4
61-
- uses: actions/setup-python@v5
60+
uses: actions/checkout@v5
61+
- uses: actions/setup-python@v6
6262
with:
6363
python-version: '3.10'
6464
- name: CMake Build
@@ -133,7 +133,7 @@ jobs:
133133
sdk_version=`echo "${{ github.ref }}" | cut -d "-" -f 3`
134134
echo "sdk_version=$sdk_version" >> $GITHUB_OUTPUT
135135
- name: Download artifacts
136-
uses: actions/download-artifact@v4
136+
uses: actions/download-artifact@v5
137137
with:
138138
path: ./android-binaries-${{ steps.get_sdk_version.outputs.sdk_version }}
139139
merge-multiple: true
@@ -142,7 +142,7 @@ jobs:
142142
run: |
143143
${{ matrix.config.command }} android-binaries-${{ steps.get_sdk_version.outputs.sdk_version }}.${{ matrix.config.suffix }} android-binaries-${{ steps.get_sdk_version.outputs.sdk_version }}
144144
- name: Download release URL
145-
uses: actions/download-artifact@v4
145+
uses: actions/download-artifact@v5
146146
with:
147147
name: release_url
148148
path: ./

.github/workflows/vvl.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
code-format:
4040
runs-on: ubuntu-24.04
4141
steps:
42-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v5
4343
with:
4444
fetch-depth: '0'
45-
- uses: actions/setup-python@v5
45+
- uses: actions/setup-python@v6
4646
with:
4747
python-version: '3.10'
4848
- name: clang-format version
@@ -62,7 +62,7 @@ jobs:
6262
# Chromium build, and some package managers don't use it.
6363
custom_hash_map: [ "ON", "OFF" ]
6464
steps:
65-
- uses: actions/checkout@v4
65+
- uses: actions/checkout@v5
6666
- uses: hendrikmuhs/[email protected]
6767
with:
6868
key: ${{ matrix.config }}-address-${{matrix.custom_hash_map}}
@@ -104,7 +104,7 @@ jobs:
104104
custom_hash_map: [ "ON" ]
105105

106106
steps:
107-
- uses: actions/checkout@v4
107+
- uses: actions/checkout@v5
108108
- uses: hendrikmuhs/[email protected]
109109
with:
110110
key: ${{ matrix.config }}-thread-${{matrix.custom_hash_map}}
@@ -131,7 +131,7 @@ jobs:
131131
strategy:
132132
fail-fast: false
133133
steps:
134-
- uses: actions/checkout@v4
134+
- uses: actions/checkout@v5
135135
- uses: hendrikmuhs/[email protected]
136136
with:
137137
key: linux-ubsan
@@ -151,7 +151,7 @@ jobs:
151151
runs-on: ubuntu-22.04
152152
name: "Ubuntu Backcompat"
153153
steps:
154-
- uses: actions/checkout@v4
154+
- uses: actions/checkout@v5
155155
- name: Test Minimum CMake Version
156156
uses: lukka/get-cmake@latest
157157
with:
@@ -177,8 +177,8 @@ jobs:
177177
matrix:
178178
arch: [ amd64, amd64_x86 ]
179179
steps:
180-
- uses: actions/checkout@v4
181-
- uses: actions/setup-python@v5
180+
- uses: actions/checkout@v5
181+
- uses: actions/setup-python@v6
182182
with:
183183
python-version: '3.10'
184184
- uses: ilammy/msvc-dev-cmd@v1
@@ -216,12 +216,12 @@ jobs:
216216
run:
217217
shell: bash
218218
steps:
219-
- uses: actions/checkout@v4
219+
- uses: actions/checkout@v5
220220
- name: Setup ccache
221221
uses: hendrikmuhs/[email protected]
222222
with:
223223
key: mingw-ccache
224-
- uses: actions/setup-python@v5
224+
- uses: actions/setup-python@v6
225225
with:
226226
python-version: '3.10'
227227
- run: |
@@ -240,8 +240,8 @@ jobs:
240240
needs: code-format
241241
runs-on: ubuntu-latest
242242
steps:
243-
- uses: actions/checkout@v4
244-
- uses: actions/setup-python@v5
243+
- uses: actions/checkout@v5
244+
- uses: actions/setup-python@v6
245245
with:
246246
python-version: '3.10'
247247
- run: python3 -m pip install pyparsing

.github/workflows/weekly-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions: write-all
1212
steps:
1313
- name: Create Tag
14-
uses: actions/github-script@v7
14+
uses: actions/github-script@v8
1515
with:
1616
script: |
1717
let output = '';

BUILD.gn

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ config("vulkan_layer_config") {
7272
vvl_sources = [
7373
"$vulkan_headers_dir/include/vulkan/vk_layer.h",
7474
"$vulkan_headers_dir/include/vulkan/vulkan.h",
75-
"layers/best_practices/best_practices_utils.cpp",
7675
"layers/best_practices/best_practices_validation.h",
7776
"layers/best_practices/bp_buffer.cpp",
7877
"layers/best_practices/bp_cmd_buffer.cpp",
@@ -92,6 +91,8 @@ vvl_sources = [
9291
"layers/best_practices/bp_state.h",
9392
"layers/best_practices/bp_state.cpp",
9493
"layers/best_practices/bp_synchronization.cpp",
94+
"layers/best_practices/bp_utils.cpp",
95+
"layers/best_practices/bp_utils.h",
9596
"layers/best_practices/bp_video.cpp",
9697
"layers/best_practices/bp_wsi.cpp",
9798
"layers/chassis/chassis.h",
@@ -106,6 +107,7 @@ vvl_sources = [
106107
"layers/containers/custom_containers.h",
107108
"layers/containers/limits.h",
108109
"layers/containers/small_container.h",
110+
"layers/containers/small_range_map.h",
109111
"layers/containers/small_vector.h",
110112
"layers/containers/span.h",
111113
"layers/containers/tls_guard.h",
@@ -119,6 +121,7 @@ vvl_sources = [
119121
"layers/core_checks/cc_cmd_buffer.cpp",
120122
"layers/core_checks/cc_cmd_buffer_dynamic.cpp",
121123
"layers/core_checks/cc_copy_blit_resolve.cpp",
124+
"layers/core_checks/cc_data_graph.cpp",
122125
"layers/core_checks/cc_descriptor.cpp",
123126
"layers/core_checks/cc_device.cpp",
124127
"layers/core_checks/cc_device_memory.cpp",
@@ -146,6 +149,7 @@ vvl_sources = [
146149
"layers/core_checks/cc_sync_vuid_maps.cpp",
147150
"layers/core_checks/cc_synchronization.cpp",
148151
"layers/core_checks/cc_synchronization.h",
152+
"layers/core_checks/cc_tensor.cpp",
149153
"layers/core_checks/cc_video.cpp",
150154
"layers/core_checks/cc_vuid_maps.cpp",
151155
"layers/core_checks/cc_vuid_maps.h",
@@ -247,12 +251,17 @@ vvl_sources = [
247251
"layers/gpuav/spirv/type_manager.h",
248252
"layers/layer_options.cpp",
249253
"layers/layer_options.h",
254+
"layers/layer_options_validation.h",
250255
"layers/object_tracker/object_lifetime_validation.h",
251256
"layers/object_tracker/object_tracker_utils.cpp",
257+
"layers/state_tracker/bind_point.h",
252258
"layers/state_tracker/buffer_state.cpp",
253259
"layers/state_tracker/buffer_state.h",
254260
"layers/state_tracker/cmd_buffer_state.cpp",
255261
"layers/state_tracker/cmd_buffer_state.h",
262+
"layers/state_tracker/data_graph_pipeline_session_state.cpp",
263+
"layers/state_tracker/data_graph_pipeline_session_state.h",
264+
"layers/state_tracker/descriptor_mode.h",
256265
"layers/state_tracker/descriptor_sets.cpp",
257266
"layers/state_tracker/descriptor_sets.h",
258267
"layers/state_tracker/device_generated_commands_state.cpp",
@@ -274,9 +283,10 @@ vvl_sources = [
274283
"layers/state_tracker/pipeline_layout_state.h",
275284
"layers/state_tracker/pipeline_state.cpp",
276285
"layers/state_tracker/pipeline_state.h",
277-
"layers/state_tracker/pipeline_sub_state.cpp",
278-
"layers/state_tracker/pipeline_sub_state.h",
286+
"layers/state_tracker/pipeline_library_state.cpp",
287+
"layers/state_tracker/pipeline_library_state.h",
279288
"layers/state_tracker/push_constant_data.h",
289+
"layers/state_tracker/query_state.cpp",
280290
"layers/state_tracker/query_state.h",
281291
"layers/state_tracker/queue_state.cpp",
282292
"layers/state_tracker/queue_state.h",
@@ -300,6 +310,8 @@ vvl_sources = [
300310
"layers/state_tracker/state_tracker.cpp",
301311
"layers/state_tracker/state_tracker.h",
302312
"layers/state_tracker/submission_reference.h",
313+
"layers/state_tracker/tensor_state.cpp",
314+
"layers/state_tracker/tensor_state.h",
303315
"layers/state_tracker/vertex_index_buffer_state.h",
304316
"layers/state_tracker/video_session_state.cpp",
305317
"layers/state_tracker/video_session_state.h",
@@ -322,15 +334,19 @@ vvl_sources = [
322334
"layers/stateless/sl_spirv.cpp",
323335
"layers/stateless/sl_spirv.h",
324336
"layers/stateless/sl_synchronization.cpp",
337+
"layers/stateless/sl_tensor.cpp",
325338
"layers/stateless/sl_utils.cpp",
326339
"layers/stateless/sl_vuid_maps.cpp",
327340
"layers/stateless/sl_vuid_maps.h",
328341
"layers/stateless/sl_wsi.cpp",
329342
"layers/stateless/stateless_validation.h",
330343
"layers/sync/sync_access_context.cpp",
331344
"layers/sync/sync_access_context.h",
345+
"layers/sync/sync_access_flags.h",
332346
"layers/sync/sync_access_state.cpp",
333347
"layers/sync/sync_access_state.h",
348+
"layers/sync/sync_barrier.cpp",
349+
"layers/sync/sync_barrier.h",
334350
"layers/sync/sync_commandbuffer.cpp",
335351
"layers/sync/sync_commandbuffer.h",
336352
"layers/sync/sync_common.cpp",
@@ -395,6 +411,9 @@ vvl_sources = [
395411
"layers/vulkan/generated/best_practices_instance_methods.h",
396412
"layers/vulkan/generated/chassis.cpp",
397413
"layers/vulkan/generated/command_validation.cpp",
414+
"layers/vulkan/generated/command_validation.h",
415+
"layers/vulkan/generated/deprecation.cpp",
416+
"layers/vulkan/generated/deprecation.h",
398417
"layers/vulkan/generated/device_features.cpp",
399418
"layers/vulkan/generated/device_features.h",
400419
"layers/vulkan/generated/dispatch_functions.h",
@@ -410,6 +429,7 @@ vvl_sources = [
410429
"layers/vulkan/generated/error_location_helper.h",
411430
"layers/vulkan/generated/feature_requirements_helper.cpp",
412431
"layers/vulkan/generated/feature_requirements_helper.h",
432+
"layers/vulkan/generated/feature_not_present.cpp",
413433
"layers/vulkan/generated/gpuav_offline_spirv.cpp",
414434
"layers/vulkan/generated/gpuav_offline_spirv.h",
415435
"layers/vulkan/generated/object_tracker.cpp",

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
# ~~~
1818
cmake_minimum_required(VERSION 3.22.1)
1919

20-
project(VVL LANGUAGES CXX)
20+
# The VERSION field is generated with the "--generated-version" flag in the generate_source.py script
21+
#
22+
# If working with unreleased extensions, make sure the header and validation version are all on the same header version
23+
project(VVL VERSION 1.4.330 LANGUAGES CXX)
2124

2225
option(VULKANSC "Build Vulkan SC validation layers" ON)
2326
option(BUILD_WSI_SCREEN_QNX_SUPPORT "Build QNX screen support" OFF)
@@ -63,6 +66,7 @@ elseif(APPLE)
6366
else()
6467
option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON)
6568
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
69+
option(BUILD_WSI_XLIB_XRANDR_SUPPORT "Build X11 Xrandr WSI support" ON)
6670
option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON)
6771

6872
if (BUILD_WSI_XCB_SUPPORT OR BUILD_WSI_XLIB_SUPPORT OR BUILD_WSI_WAYLAND_SUPPORT)
@@ -76,7 +80,11 @@ else()
7680

7781
if(BUILD_WSI_XLIB_SUPPORT)
7882
pkg_check_modules(X11 REQUIRED QUIET IMPORTED_TARGET x11)
79-
add_compile_definitions(VK_USE_PLATFORM_XLIB_KHR VK_USE_PLATFORM_XLIB_XRANDR_EXT)
83+
add_compile_definitions(VK_USE_PLATFORM_XLIB_KHR)
84+
if(BUILD_WSI_XLIB_XRANDR_SUPPORT)
85+
pkg_check_modules(XRANDR REQUIRED QUIET IMPORTED_TARGET xrandr)
86+
add_compile_definitions(VK_USE_PLATFORM_XLIB_XRANDR_EXT)
87+
endif()
8088
endif()
8189

8290
if(BUILD_WSI_WAYLAND_SUPPORT)
@@ -125,8 +133,7 @@ if (VVL_ENABLE_TRACY)
125133
endif()
126134
endif()
127135

128-
129-
find_package(VulkanHeaders CONFIG QUIET)
136+
find_package(VulkanHeaders ${PROJECT_VERSION} CONFIG QUIET)
130137

131138
find_package(VulkanUtilityLibraries CONFIG QUIET)
132139

GOVERNANCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Vulkan Validation Layers Repository Management
22

3-
# **Open Source Project Objectives**
3+
# **Open Source Project - Objectives**
44

55
* Alignment with the Vulkan Specification
66
- The goal is for validation layer behavior to enforce the vulkan specification on applications. Questions on specification

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ For those who don't want to build from source, there are few ways to get working
1616
- For Android, each SDK tag will have binaries to download (example: [vulkan-sdk-1.3.280.0 tag](https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/tag/vulkan-sdk-1.3.280.0))
1717
- Every change applied to the main branch runs through GitHub action and will [produce artifacts](https://github.com/KhronosGroup/Vulkan-ValidationLayers/actions?query=branch%3Amain) of the latest commit.
1818

19+
## Ways to enable the layer
20+
21+
* Use [*Vulkan Configurator*](https://www.lunarg.com/introducing-the-new-vulkan-configurator-vkconfig/)
22+
* Set environment variables
23+
* Windows `set VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`
24+
* Linux `export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`
25+
* [Android](https://developer.android.com/ndk/guides/graphics/validation-layer)
26+
* [More information](https://vulkan.lunarg.com/doc/view/latest/windows/layer_configuration.html)
27+
1928
## Adjusting Settings
2029

2130
See [documentation](./docs/khronos_validation_layer.md#configuring-the-validation-layer).

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This directory contains more detailed information about how each part of the Val
88
- [Best Practices Validation](./best_practices.md)
99
- [Error Object (information used to print better error messages)](./error_object.md)
1010
- [Shader Debug Printf](./debug_printf.md)
11+
- [Deprecation Detection](./deprecation_detection.md)
1112
- [Fine Grained Locking](./fine_grained_locking.md)
1213
- [Fine Grained Locking - Usage](./fine_grained_locking_usage.md)
1314
- [Generated Code](./generated_code.md)

docs/chassis.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Introduction
22

3-
The Vulkan-ValidationLayers project has had its architecture evolve several times since it was started. Initially, validation was implemented as independent layers, which could be enabled using the vulkan loader. This design had high overhead and was difficult to test since the layers could be enabled in any order, which could cause very different behaviors.
3+
The Vulkan-ValidationLayers project has had its architecture evolve several times since it was started. Initially, validation was implemented as independent layers, which could be enabled using the vulkan loader. This design had high overhead and was difficult to test since the layers could be enabled in any order, which could cause very different behaviors.
44

55
So all of the separate layers were combined into a single layer. The original layers were now called validation objects. A component called the chassis was made which intercepts vulkan commands and let validation objects do validation and track state. Several of the validation objects used common code to do state tracking, but since state tracking was implemented in a base class, each validation object had its own copy of the state data. This was redundant both for memory and CPU overhead.
66

@@ -36,7 +36,7 @@ The dispatch objects also store cached copies of device properties, enabled feat
3636

3737
### Handle wrapping
3838

39-
Validation has an option to replace ICD handles with generated handles which are not pointers and should be consistent run to run. Unfortunately this requires some state tracking to properly substitute in the correct handles when calling down to the ICD. This state is a separate subset of what is done by the state tracker.
39+
Validation has an option to replace ICD handles with generated handles which are not pointers and should be consistent run to run. Unfortunately this requires some state tracking to properly substitute in the correct handles when calling down to the ICD. This state is a separate subset of what is done by the state tracker.
4040

4141
## Base validation objects
4242

@@ -56,3 +56,52 @@ The diagram above shows the class hierarchy used for validation objects.
5656

5757
Some validations objects require additional state to be tracked for various state objects, such as command buffers, images and queues. When each validation type had its own state tracker, this was implemented using derived classes and factory methods for creating state objects. With the shared state tracker, specialization by inheritance is not possible. Instead, some state objects implement sub states, which can be used to store additional data. Some sub state types also provide virtual methods which can be overridden to perform actions when something happens to the state object. When this happens, the substates are called in the same order used by the dispatch objects.
5858

59+
## Command Buffers
60+
61+
`VkCommandBuffer` objects is where most of the state tracking occurs. Currently the `vvl::CommandBuffer` object is easily 3 or 4x larger then the next state object. From profiling, a lot of wall clock time is spend in `vkCmd*` calls not because they are slow, but because they will get called millions of times in real world applications.
62+
63+
We adopt a slightly different strategy with them, instead of using the chassis `PreCallRecord`/`PostCallRecord`, for as many spots as possible we want to funnel things through the `vvl::CommanBuffer` state object itself for recording.
64+
65+
What was once
66+
67+
```c++
68+
// state_tracker.cpp
69+
void DeviceState::PostCallRecordCmdXXX() {
70+
auto cb_state = GetWrite<CommandBuffer>(commandBuffer);
71+
cb_state->state_a = 1;
72+
cb_state->state_b = 2;
73+
}
74+
75+
// cc_xxx.cpp
76+
void CoreCheck::PostCallRecordCmdXXX() {
77+
auto cb_state = GetWrite<CommandBuffer>(commandBuffer);
78+
const auto &cb_sub_state = core::SubState(*cb_state);
79+
cb_state->state_c = 3;
80+
cb_sub_state->state_d = 4;
81+
}
82+
```
83+
84+
Now turned into
85+
86+
```c++
87+
void DeviceState::PostCallRecordCmdXXX() {
88+
auto cb_state = GetWrite<CommandBuffer>(commandBuffer); // one state lookup for command buffer
89+
cb_state->RecordXXX();
90+
}
91+
92+
// cmd_buffer_state.cpp
93+
void CommandBuffer::RecordXX() {
94+
state_a = 1;
95+
state_b = 2;
96+
97+
for (auto &item : sub_states_) {
98+
item.second->RecordXX();
99+
}
100+
}
101+
102+
// cc_state_tracker.cpp, gpuav_state_tracker.cpp, bp_state.cpp, etc
103+
void CommandBufferSubState::RecordXX() {
104+
base.state_c = 3;
105+
state_d = 4;
106+
}
107+
```

0 commit comments

Comments
 (0)