From 66a74b451a753af1b17bb2a50cf6442590accdb8 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Sat, 4 Oct 2025 12:18:35 +0200 Subject: [PATCH] Add type definition to validation layer vector --- attachments/02_validation_layers.cpp | 2 +- attachments/03_physical_device_selection.cpp | 2 +- attachments/04_logical_device.cpp | 2 +- attachments/05_window_surface.cpp | 2 +- attachments/06_swap_chain_creation.cpp | 2 +- attachments/07_image_views.cpp | 2 +- attachments/08_graphics_pipeline.cpp | 2 +- attachments/09_shader_modules.cpp | 2 +- attachments/10_fixed_functions.cpp | 2 +- attachments/12_graphics_pipeline_complete.cpp | 2 +- attachments/14_command_buffers.cpp | 2 +- attachments/15_hello_triangle.cpp | 2 +- attachments/16_frames_in_flight.cpp | 2 +- attachments/17_swap_chain_recreation.cpp | 2 +- attachments/18_vertex_input.cpp | 2 +- attachments/19_vertex_buffer.cpp | 2 +- attachments/20_staging_buffer.cpp | 2 +- attachments/21_index_buffer.cpp | 2 +- attachments/22_descriptor_layout.cpp | 2 +- attachments/23_descriptor_sets.cpp | 2 +- attachments/24_texture_image.cpp | 2 +- attachments/25_sampler.cpp | 2 +- attachments/26_texture_mapping.cpp | 2 +- attachments/27_depth_buffering.cpp | 2 +- attachments/28_model_loading.cpp | 2 +- attachments/29_mipmapping.cpp | 2 +- attachments/30_multisampling.cpp | 2 +- attachments/31_compute_shader.cpp | 2 +- attachments/38_ray_tracing.cpp | 2 +- en/03_Drawing_a_triangle/00_Setup/02_Validation_layers.adoc | 2 +- en/12_Ecosystem_Utilities_and_Compatibility.adoc | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/attachments/02_validation_layers.cpp b/attachments/02_validation_layers.cpp index 6aef3863..0c3c73fe 100644 --- a/attachments/02_validation_layers.cpp +++ b/attachments/02_validation_layers.cpp @@ -20,7 +20,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/03_physical_device_selection.cpp b/attachments/03_physical_device_selection.cpp index 63fecd50..287d9cdc 100644 --- a/attachments/03_physical_device_selection.cpp +++ b/attachments/03_physical_device_selection.cpp @@ -20,7 +20,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/04_logical_device.cpp b/attachments/04_logical_device.cpp index ee42963a..06a24989 100644 --- a/attachments/04_logical_device.cpp +++ b/attachments/04_logical_device.cpp @@ -21,7 +21,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/05_window_surface.cpp b/attachments/05_window_surface.cpp index b08fa68c..2c251cfd 100644 --- a/attachments/05_window_surface.cpp +++ b/attachments/05_window_surface.cpp @@ -20,7 +20,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/06_swap_chain_creation.cpp b/attachments/06_swap_chain_creation.cpp index 3fff257c..d84434ed 100644 --- a/attachments/06_swap_chain_creation.cpp +++ b/attachments/06_swap_chain_creation.cpp @@ -22,7 +22,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/07_image_views.cpp b/attachments/07_image_views.cpp index 790832af..1bdcef13 100644 --- a/attachments/07_image_views.cpp +++ b/attachments/07_image_views.cpp @@ -22,7 +22,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/08_graphics_pipeline.cpp b/attachments/08_graphics_pipeline.cpp index 58d09622..f569c99e 100644 --- a/attachments/08_graphics_pipeline.cpp +++ b/attachments/08_graphics_pipeline.cpp @@ -22,7 +22,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/09_shader_modules.cpp b/attachments/09_shader_modules.cpp index 29853b9f..6a258444 100644 --- a/attachments/09_shader_modules.cpp +++ b/attachments/09_shader_modules.cpp @@ -23,7 +23,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/10_fixed_functions.cpp b/attachments/10_fixed_functions.cpp index 3aa1238b..2e421831 100644 --- a/attachments/10_fixed_functions.cpp +++ b/attachments/10_fixed_functions.cpp @@ -23,7 +23,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/12_graphics_pipeline_complete.cpp b/attachments/12_graphics_pipeline_complete.cpp index 7ca1313c..8088e3cd 100644 --- a/attachments/12_graphics_pipeline_complete.cpp +++ b/attachments/12_graphics_pipeline_complete.cpp @@ -23,7 +23,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/14_command_buffers.cpp b/attachments/14_command_buffers.cpp index 864edec0..0a6d13d7 100644 --- a/attachments/14_command_buffers.cpp +++ b/attachments/14_command_buffers.cpp @@ -23,7 +23,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/15_hello_triangle.cpp b/attachments/15_hello_triangle.cpp index 2e9ebb60..f81aedc3 100644 --- a/attachments/15_hello_triangle.cpp +++ b/attachments/15_hello_triangle.cpp @@ -23,7 +23,7 @@ import vulkan_hpp; constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/16_frames_in_flight.cpp b/attachments/16_frames_in_flight.cpp index 2c129802..ded67850 100644 --- a/attachments/16_frames_in_flight.cpp +++ b/attachments/16_frames_in_flight.cpp @@ -24,7 +24,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/17_swap_chain_recreation.cpp b/attachments/17_swap_chain_recreation.cpp index 7fc4ef75..eabd1dbe 100644 --- a/attachments/17_swap_chain_recreation.cpp +++ b/attachments/17_swap_chain_recreation.cpp @@ -24,7 +24,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/18_vertex_input.cpp b/attachments/18_vertex_input.cpp index 010059b4..e7afb8d6 100644 --- a/attachments/18_vertex_input.cpp +++ b/attachments/18_vertex_input.cpp @@ -26,7 +26,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/19_vertex_buffer.cpp b/attachments/19_vertex_buffer.cpp index d50a5e0c..f2adf4cf 100644 --- a/attachments/19_vertex_buffer.cpp +++ b/attachments/19_vertex_buffer.cpp @@ -26,7 +26,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/20_staging_buffer.cpp b/attachments/20_staging_buffer.cpp index 2b056975..5b33564c 100644 --- a/attachments/20_staging_buffer.cpp +++ b/attachments/20_staging_buffer.cpp @@ -26,7 +26,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/21_index_buffer.cpp b/attachments/21_index_buffer.cpp index d727fce9..a97587cb 100644 --- a/attachments/21_index_buffer.cpp +++ b/attachments/21_index_buffer.cpp @@ -26,7 +26,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/22_descriptor_layout.cpp b/attachments/22_descriptor_layout.cpp index 4addf1ec..d42cee1c 100644 --- a/attachments/22_descriptor_layout.cpp +++ b/attachments/22_descriptor_layout.cpp @@ -30,7 +30,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/23_descriptor_sets.cpp b/attachments/23_descriptor_sets.cpp index ed2839b4..35d2baf1 100644 --- a/attachments/23_descriptor_sets.cpp +++ b/attachments/23_descriptor_sets.cpp @@ -30,7 +30,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/24_texture_image.cpp b/attachments/24_texture_image.cpp index 9773cceb..40ff7c67 100644 --- a/attachments/24_texture_image.cpp +++ b/attachments/24_texture_image.cpp @@ -33,7 +33,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/25_sampler.cpp b/attachments/25_sampler.cpp index b2571173..8eb18677 100644 --- a/attachments/25_sampler.cpp +++ b/attachments/25_sampler.cpp @@ -33,7 +33,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/26_texture_mapping.cpp b/attachments/26_texture_mapping.cpp index 30cda574..9ab59481 100644 --- a/attachments/26_texture_mapping.cpp +++ b/attachments/26_texture_mapping.cpp @@ -33,7 +33,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/27_depth_buffering.cpp b/attachments/27_depth_buffering.cpp index ebb596a6..0b57310b 100644 --- a/attachments/27_depth_buffering.cpp +++ b/attachments/27_depth_buffering.cpp @@ -34,7 +34,7 @@ constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/28_model_loading.cpp b/attachments/28_model_loading.cpp index 5c72ab66..a1e41ed2 100644 --- a/attachments/28_model_loading.cpp +++ b/attachments/28_model_loading.cpp @@ -42,7 +42,7 @@ const std::string MODEL_PATH = "models/viking_room.obj"; const std::string TEXTURE_PATH = "textures/viking_room.png"; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/29_mipmapping.cpp b/attachments/29_mipmapping.cpp index 4a0455f0..2a028113 100644 --- a/attachments/29_mipmapping.cpp +++ b/attachments/29_mipmapping.cpp @@ -42,7 +42,7 @@ const std::string MODEL_PATH = "models/viking_room.obj"; const std::string TEXTURE_PATH = "textures/viking_room.png"; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/30_multisampling.cpp b/attachments/30_multisampling.cpp index bd5a4d06..67ab5b15 100644 --- a/attachments/30_multisampling.cpp +++ b/attachments/30_multisampling.cpp @@ -42,7 +42,7 @@ const std::string MODEL_PATH = "models/viking_room.obj"; const std::string TEXTURE_PATH = "textures/viking_room.png"; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/31_compute_shader.cpp b/attachments/31_compute_shader.cpp index e2ef808a..cc2087c9 100644 --- a/attachments/31_compute_shader.cpp +++ b/attachments/31_compute_shader.cpp @@ -37,7 +37,7 @@ constexpr uint32_t PARTICLE_COUNT = 8192; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/attachments/38_ray_tracing.cpp b/attachments/38_ray_tracing.cpp index 0c4b6f3e..2a0fbedb 100644 --- a/attachments/38_ray_tracing.cpp +++ b/attachments/38_ray_tracing.cpp @@ -50,7 +50,7 @@ constexpr uint64_t FenceTimeout = 100000000; const std::string MODEL_PATH = "models/plant_on_table.obj"; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/en/03_Drawing_a_triangle/00_Setup/02_Validation_layers.adoc b/en/03_Drawing_a_triangle/00_Setup/02_Validation_layers.adoc index 822ae81a..ce98a468 100644 --- a/en/03_Drawing_a_triangle/00_Setup/02_Validation_layers.adoc +++ b/en/03_Drawing_a_triangle/00_Setup/02_Validation_layers.adoc @@ -93,7 +93,7 @@ is part of the c{pp} standard and means "not debug". constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" }; diff --git a/en/12_Ecosystem_Utilities_and_Compatibility.adoc b/en/12_Ecosystem_Utilities_and_Compatibility.adoc index bf0c365c..87f090af 100644 --- a/en/12_Ecosystem_Utilities_and_Compatibility.adoc +++ b/en/12_Ecosystem_Utilities_and_Compatibility.adoc @@ -103,7 +103,7 @@ In many Vulkan applications, validation layers are enabled programmatically duri [,c++] ---- // Define validation layers -const std::vector validationLayers = { +const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" };