From 7ce1eb5906dace0f2f9fa78706c92161ddcd4027 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Wed, 30 Dec 2015 08:16:12 -0700 Subject: [PATCH] layers: Rename Layer/library/json files for consistency Renamed layers from (for example) xxx_DrawState to xxx_draw_state Renamed JSON files Renamed libraries Renamed object_track.* to object_tracker.* Renamed apidump.h to api_dump.h Renamed screen_shot layer to screenshot Renamed APIDump layer settings file options to ApiDump Bug fixes here and there from prior renames --- buildAndroid/android-generate.sh | 9 +- buildAndroid/jni/Android.mk | 25 ++-- buildAndroid/jni/Application.mk | 3 +- demos/cube.c | 32 ++--- demos/tri.c | 4 +- layers/CMakeLists.txt | 96 +++++++-------- layers/README.md | 32 ++--- layers/{apidump.h => api_dump.h} | 6 +- layers/basic.cpp | 6 +- layers/draw_state.cpp | 6 +- layers/generic.h | 6 +- layers/image.cpp | 2 +- .../VkLayer_api_dump.json} | 4 +- .../linux/{basic.json => VkLayer_basic.json} | 4 +- ...licit.json => VkLayer_basic_implicit.json} | 4 +- layers/linux/VkLayer_device_limits.json | 17 +++ ...raw_state.json => VkLayer_draw_state.json} | 4 +- .../VkLayer_generic.json} | 4 +- .../image.json => linux/VkLayer_image.json} | 4 +- layers/linux/VkLayer_mem_tracker.json | 17 +++ .../linux/{multi.json => VkLayer_multi.json} | 4 +- layers/linux/VkLayer_object_tracker.json | 17 +++ layers/linux/VkLayer_param_checker.json | 17 +++ .../VkLayer_screenshot.json} | 4 +- layers/linux/VkLayer_swapchain.json | 17 +++ layers/linux/VkLayer_threading.json | 17 +++ layers/linux/param_checker.json | 17 --- layers/mem_tracker.cpp | 2 +- layers/{object_track.h => object_tracker.h} | 44 ++++--- layers/param_checker.cpp | 4 +- layers/screenshot.cpp | 4 +- layers/swapchain.cpp | 4 +- layers/swapchain.h | 4 +- layers/threading.h | 4 +- layers/vk_layer_settings.txt | 28 ++--- layers/vk_validation_layer_details.md | 110 +++++++++--------- .../VkLayer_api_dump.json} | 4 +- .../{basic.json => VkLayer_basic.json} | 4 +- .../VkLayer_device_limits.json} | 4 +- ...raw_state.json => VkLayer_draw_state.json} | 4 +- .../VkLayer_generic.json} | 6 +- .../image.json => windows/VkLayer_image.json} | 4 +- .../VkLayer_mem_tracker.json} | 4 +- .../{multi.json => VkLayer_multi.json} | 4 +- layers/windows/VkLayer_object_tracker.json | 17 +++ .../VkLayer_param_checker.json} | 4 +- .../VkLayer_screenshot.json} | 4 +- .../VkLayer_swapchain.json} | 4 +- .../VkLayer_threading.json} | 4 +- layers/windows/device_limits.json | 17 --- layers/windows/mem_tracker.json | 17 --- layers/windows/object_tracker.json | 17 --- layers/windows/param_checker.json | 17 --- layers/windows/swapchain.json | 17 --- layers/windows/threading.json | 17 --- vk-generate.py | 8 +- vk-layer-generate.py | 102 ++++++++-------- 57 files changed, 431 insertions(+), 430 deletions(-) rename layers/{apidump.h => api_dump.h} (98%) rename layers/{windows/api_dump.json => linux/VkLayer_api_dump.json} (68%) rename layers/linux/{basic.json => VkLayer_basic.json} (82%) rename layers/linux/{basic_implicit.json => VkLayer_basic_implicit.json} (81%) create mode 100644 layers/linux/VkLayer_device_limits.json rename layers/linux/{draw_state.json => VkLayer_draw_state.json} (85%) rename layers/{windows/generic.json => linux/VkLayer_generic.json} (68%) rename layers/{windows/image.json => linux/VkLayer_image.json} (80%) create mode 100644 layers/linux/VkLayer_mem_tracker.json rename layers/linux/{multi.json => VkLayer_multi.json} (87%) create mode 100644 layers/linux/VkLayer_object_tracker.json create mode 100644 layers/linux/VkLayer_param_checker.json rename layers/{windows/screenshot.json => linux/VkLayer_screenshot.json} (68%) create mode 100644 layers/linux/VkLayer_swapchain.json create mode 100644 layers/linux/VkLayer_threading.json delete mode 100644 layers/linux/param_checker.json rename layers/{object_track.h => object_tracker.h} (95%) rename layers/{linux/api_dump.json => windows/VkLayer_api_dump.json} (68%) rename layers/windows/{basic.json => VkLayer_basic.json} (82%) rename layers/{linux/device_limits.json => windows/VkLayer_device_limits.json} (77%) rename layers/windows/{draw_state.json => VkLayer_draw_state.json} (85%) rename layers/{linux/generic.json => windows/VkLayer_generic.json} (54%) rename layers/{linux/image.json => windows/VkLayer_image.json} (80%) rename layers/{linux/mem_tracker.json => windows/VkLayer_mem_tracker.json} (78%) rename layers/windows/{multi.json => VkLayer_multi.json} (87%) create mode 100644 layers/windows/VkLayer_object_tracker.json rename layers/{linux/object_tracker.json => windows/VkLayer_param_checker.json} (77%) rename layers/{linux/screenshot.json => windows/VkLayer_screenshot.json} (68%) rename layers/{linux/swapchain.json => windows/VkLayer_swapchain.json} (79%) rename layers/{linux/threading.json => windows/VkLayer_threading.json} (79%) delete mode 100644 layers/windows/device_limits.json delete mode 100644 layers/windows/mem_tracker.json delete mode 100644 layers/windows/object_tracker.json delete mode 100644 layers/windows/param_checker.json delete mode 100644 layers/windows/swapchain.json delete mode 100644 layers/windows/threading.json diff --git a/buildAndroid/android-generate.sh b/buildAndroid/android-generate.sh index e3e59e9b..c8fda268 100755 --- a/buildAndroid/android-generate.sh +++ b/buildAndroid/android-generate.sh @@ -1,6 +1,7 @@ #!/bin/bash # Copyright 2015 The Android Open Source Project +# Copyright (C) 2015 Valve Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,8 +22,8 @@ python ../vk-generate.py dispatch-table-ops layer > generated/vk_dispatch_table_ python ../vk_helper.py --gen_enum_string_helper ../include/vulkan/vulkan.h --abs_out_dir generated python ../vk_helper.py --gen_struct_wrappers ../include/vulkan/vulkan.h --abs_out_dir generated -python ../vk-layer-generate.py Generic ../include/vulkan/vulkan.h > generated/generic_layer.cpp -python ../vk-layer-generate.py APIDump ../include/vulkan/vulkan.h > generated/api_dump.cpp -python ../vk-layer-generate.py ObjectTracker ../include/vulkan/vulkan.h > generated/object_track.cpp -python ../vk-layer-generate.py Threading ../include/vulkan/vulkan.h > generated/threading.cpp +python ../vk-layer-generate.py generic ../include/vulkan/vulkan.h > generated/generic_layer.cpp +python ../vk-layer-generate.py api_dump ../include/vulkan/vulkan.h > generated/api_dump.cpp +python ../vk-layer-generate.py object_tracker ../include/vulkan/vulkan.h > generated/object_tracker.cpp +python ../vk-layer-generate.py threading ../include/vulkan/vulkan.h > generated/threading.cpp diff --git a/buildAndroid/jni/Android.mk b/buildAndroid/jni/Android.mk index f8d93713..1526711f 100644 --- a/buildAndroid/jni/Android.mk +++ b/buildAndroid/jni/Android.mk @@ -1,4 +1,5 @@ # Copyright 2015 The Android Open Source Project +# Copyright (C) 2015 Valve Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,7 +27,7 @@ LOCAL_CPPFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerBasic +LOCAL_MODULE := VkLayer_basic LOCAL_SRC_FILES += $(SRC_DIR)/layers/basic.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ @@ -37,7 +38,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerDrawState +LOCAL_MODULE := VkLayer_draw_state LOCAL_SRC_FILES += $(SRC_DIR)/layers/draw_state.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_debug_marker_table.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp @@ -51,7 +52,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerMemTracker +LOCAL_MODULE := VkLayer_mem_tracker LOCAL_SRC_FILES += $(SRC_DIR)/layers/mem_tracker.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ @@ -63,7 +64,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerDeviceLimits +LOCAL_MODULE := VkLayer_device_limits LOCAL_SRC_FILES += $(SRC_DIR)/layers/device_limits.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_debug_marker_table.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ @@ -75,7 +76,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerImage +LOCAL_MODULE := VkLayer_image LOCAL_SRC_FILES += $(SRC_DIR)/layers/image.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ @@ -87,7 +88,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerParamChecker +LOCAL_MODULE := VkLayer_param_checker LOCAL_SRC_FILES += $(SRC_DIR)/layers/param_checker.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_debug_marker_table.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp @@ -100,7 +101,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerGeneric +LOCAL_MODULE := VkLayer_generic LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/generic_layer.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ @@ -113,7 +114,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerAPIDump +LOCAL_MODULE := VkLayer_api_dump LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/api_dump.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ @@ -126,8 +127,8 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerObjectTracker -LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/object_track.cpp +LOCAL_MODULE := VkLayer_object_tracker +LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/object_tracker.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ $(SRC_DIR)/layers \ @@ -139,7 +140,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerThreading +LOCAL_MODULE := VkLayer_threading LOCAL_SRC_FILES += $(SRC_DIR)/buildAndroid/generated/threading.cpp LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp LOCAL_C_INCLUDES += $(SRC_DIR)/include \ @@ -152,7 +153,7 @@ LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_MODULE := VKLayerValidationTests +LOCAL_MODULE := VkLayerValidationTests LOCAL_SRC_FILES += $(SRC_DIR)/tests/layer_validation_tests.cpp \ $(SRC_DIR)/tests/vktestbinding.cpp \ $(SRC_DIR)/tests/vktestframeworkandroid.cpp \ diff --git a/buildAndroid/jni/Application.mk b/buildAndroid/jni/Application.mk index f5aa22cb..0fb770aa 100644 --- a/buildAndroid/jni/Application.mk +++ b/buildAndroid/jni/Application.mk @@ -1,4 +1,5 @@ # Copyright 2015 The Android Open Source Project +# Copyright (C) 2015 Valve Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,6 +16,6 @@ APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 mips mips64 APP_PLATFORM := android-22 APP_STL := gnustl_static -APP_MODULES := layer_utils VKLayerBasic VKLayerDrawState VKLayerMemTracker VKLayerDeviceLimits VKLayerImage VKLayerParamChecker VKLayerGeneric VKLayerAPIDump VKLayerObjectTracker VKLayerThreading VKLayerValidationTests +APP_MODULES := layer_utils VkLayer_basic VkLayer_draw_state VkLayer_mem_tracker VkLayer_device_limits VkLayer_image VkLayer_param_checker VkLayer_generic VkLayer_api_dump VkLayer_object_tracker VkLayer_threading VkLayerValidationTests APP_CPPFLAGS += -std=c++11 -DVK_PROTOTYPES NDK_TOOLCHAIN_VERSION := 4.8 diff --git a/demos/cube.c b/demos/cube.c index 89f409a7..5beedec3 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -2130,25 +2130,25 @@ static void demo_init_vk(struct demo *demo) uint32_t enabled_layer_count = 0; char *instance_validation_layers[] = { - "VK_LAYER_LUNARG_Threading", - "VK_LAYER_LUNARG_MemTracker", - "VK_LAYER_LUNARG_ObjectTracker", - "VK_LAYER_LUNARG_DrawState", - "VK_LAYER_LUNARG_ParamChecker", - "VK_LAYER_LUNARG_Swapchain", - "VK_LAYER_LUNARG_DeviceLimits", - "VK_LAYER_LUNARG_Image", + "VK_LAYER_LUNARG_threading", + "VK_LAYER_LUNARG_mem_tracker", + "VK_LAYER_LUNARG_object_tracker", + "VK_LAYER_LUNARG_draw_state", + "VK_LAYER_LUNARG_param_checker", + "VK_LAYER_LUNARG_swapchain", + "VK_LAYER_LUNARG_device_limits", + "VK_LAYER_LUNARG_image", }; char *device_validation_layers[] = { - "VK_LAYER_LUNARG_Threading", - "VK_LAYER_LUNARG_MemTracker", - "VK_LAYER_LUNARG_ObjectTracker", - "VK_LAYER_LUNARG_DrawState", - "VK_LAYER_LUNARG_ParamChecker", - "VK_LAYER_LUNARG_Swapchain", - "VK_LAYER_LUNARG_DeviceLimits", - "VK_LAYER_LUNARG_Image", + "VK_LAYER_LUNARG_threading", + "VK_LAYER_LUNARG_mem_tracker", + "VK_LAYER_LUNARG_object_tracker", + "VK_LAYER_LUNARG_draw_state", + "VK_LAYER_LUNARG_param_checker", + "VK_LAYER_LUNARG_swapchain", + "VK_LAYER_LUNARG_device_limits", + "VK_LAYER_LUNARG_image", }; /* Look for validation layers */ diff --git a/demos/tri.c b/demos/tri.c index 0db21673..53457217 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -1730,11 +1730,11 @@ static void demo_init_vk(struct demo *demo) uint32_t enabled_layer_count = 0; char *instance_validation_layers[] = { - "VK_LUNARG_LAYER_MemTracker", + "VK_LUNARG_LAYER_mem_tracker", }; char *device_validation_layers[] = { - "VK_LUNARG_LAYER_MemTracker", + "VK_LUNARG_LAYER_mem_tracker", }; /* Look for validation layers */ diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt index 905861ff..1c47165b 100644 --- a/layers/CMakeLists.txt +++ b/layers/CMakeLists.txt @@ -15,19 +15,19 @@ macro(run_vk_layer_generate subcmd output) endmacro() set(LAYER_JSON_FILES - api_dump - basic - draw_state - generic - image - mem_tracker - multi - object_tracker - param_checker - screenshot - swapchain - threading - device_limits + VkLayer_api_dump + VkLayer_basic + VkLayer_draw_state + VkLayer_generic + VkLayer_image + VkLayer_mem_tracker + VkLayer_multi + VkLayer_object_tracker + VkLayer_param_checker + VkLayer_screenshot + VkLayer_swapchain + VkLayer_threading + VkLayer_device_limits ) set(VK_LAYER_RPATH /usr/lib/x86_64-linux-gnu/vulkan/layer:/usr/lib/i386-linux-gnu/vulkan/layer) @@ -58,23 +58,23 @@ endif() if (WIN32) macro(add_vk_layer target) - add_custom_command(OUTPUT VKLayer${target}.def - COMMAND ${PYTHON_CMD} ${PROJECT_SOURCE_DIR}/vk-generate.py win-def-file VKLayer${target} layer > VKLayer${target}.def + add_custom_command(OUTPUT VkLayer_${target}.def + COMMAND ${PYTHON_CMD} ${PROJECT_SOURCE_DIR}/vk-generate.py win-def-file VkLayer_${target} layer > VkLayer_${target}.def DEPENDS ${PROJECT_SOURCE_DIR}/vk-generate.py ${PROJECT_SOURCE_DIR}/vk.py ) - add_library(VKLayer${target} SHARED ${ARGN} VKLayer${target}.def) - target_link_Libraries(VKLayer${target} layer_utils) - add_dependencies(VKLayer${target} layer_utils_static) - add_dependencies(VKLayer${target} generate_vk_layer_helpers) - set_target_properties(VKLayer${target} PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/VKLayer${target}.def") + add_library(VkLayer_${target} SHARED ${ARGN} VkLayer_${target}.def) + target_link_Libraries(VkLayer_${target} layer_utils) + add_dependencies(VkLayer_${target} layer_utils_static) + add_dependencies(VkLayer_${target} generate_vk_layer_helpers) + set_target_properties(VkLayer_${target} PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/VkLayer_${target}.def") endmacro() else() macro(add_vk_layer target) - add_library(VKLayer${target} SHARED ${ARGN}) - target_link_Libraries(VKLayer${target} layer_utils) - add_dependencies(VKLayer${target} generate_vk_layer_helpers) - set_target_properties(VKLayer${target} PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic") - install(TARGETS VKLayer${target} DESTINATION ${PROJECT_BINARY_DIR}/install_staging) + add_library(VkLayer_${target} SHARED ${ARGN}) + target_link_Libraries(VkLayer_${target} layer_utils) + add_dependencies(VkLayer_${target} generate_vk_layer_helpers) + set_target_properties(VkLayer_${target} PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic") + install(TARGETS VkLayer_${target} DESTINATION ${PROJECT_BINARY_DIR}/install_staging) endmacro() endif() @@ -103,11 +103,11 @@ add_custom_command(OUTPUT vk_dispatch_table_helper.h run_vk_helper(gen_enum_string_helper vk_enum_string_helper.h) run_vk_helper(gen_struct_wrappers vk_struct_string_helper.h - vk_struct_string_helper_cpp.h + vk_struct_string_helper_cpp.h vk_struct_string_helper_no_addr.h vk_struct_string_helper_no_addr_cpp.h - vk_struct_size_helper.h - vk_struct_size_helper.c + vk_struct_size_helper.h + vk_struct_size_helper.c vk_struct_wrappers.h vk_struct_wrappers.cpp ) @@ -117,18 +117,18 @@ add_custom_target(generate_vk_layer_helpers DEPENDS vk_enum_string_helper.h vk_struct_string_helper.h vk_struct_string_helper_no_addr.h - vk_struct_string_helper_cpp.h + vk_struct_string_helper_cpp.h vk_struct_string_helper_no_addr_cpp.h - vk_struct_size_helper.h - vk_struct_size_helper.c + vk_struct_size_helper.h + vk_struct_size_helper.c vk_struct_wrappers.h vk_struct_wrappers.cpp ) -run_vk_layer_generate(Generic generic_layer.cpp) -run_vk_layer_generate(APIDump api_dump.cpp) -run_vk_layer_generate(ObjectTracker object_track.cpp) -run_vk_layer_generate(Threading threading.cpp) +run_vk_layer_generate(generic generic_layer.cpp) +run_vk_layer_generate(api_dump api_dump.cpp) +run_vk_layer_generate(object_tracker object_tracker.cpp) +run_vk_layer_generate(threading threading.cpp) add_library(layer_utils SHARED vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp) if (WIN32) @@ -139,17 +139,17 @@ else() install(TARGETS layer_utils DESTINATION ${PROJECT_BINARY_DIR}/install_staging) endif() -add_vk_layer(Basic basic.cpp vk_layer_table.cpp) -add_vk_layer(Multi multi.cpp vk_layer_table.cpp) -add_vk_layer(DrawState draw_state.cpp vk_layer_debug_marker_table.cpp vk_layer_table.cpp) -add_vk_layer(DeviceLimits device_limits.cpp vk_layer_debug_marker_table.cpp vk_layer_table.cpp vk_layer_utils.cpp) -add_vk_layer(MemTracker mem_tracker.cpp vk_layer_table.cpp) -add_vk_layer(Image image.cpp vk_layer_table.cpp) -add_vk_layer(ParamChecker param_checker.cpp vk_layer_debug_marker_table.cpp vk_layer_table.cpp) -add_vk_layer(ScreenShot screenshot.cpp vk_layer_table.cpp) -add_vk_layer(Swapchain swapchain.cpp vk_layer_table.cpp) +add_vk_layer(basic basic.cpp vk_layer_table.cpp) +add_vk_layer(multi multi.cpp vk_layer_table.cpp) +add_vk_layer(draw_state draw_state.cpp vk_layer_debug_marker_table.cpp vk_layer_table.cpp) +add_vk_layer(device_limits device_limits.cpp vk_layer_debug_marker_table.cpp vk_layer_table.cpp vk_layer_utils.cpp) +add_vk_layer(mem_tracker mem_tracker.cpp vk_layer_table.cpp) +add_vk_layer(image image.cpp vk_layer_table.cpp) +add_vk_layer(param_checker param_checker.cpp vk_layer_debug_marker_table.cpp vk_layer_table.cpp) +add_vk_layer(screenshot screenshot.cpp vk_layer_table.cpp) +add_vk_layer(swapchain swapchain.cpp vk_layer_table.cpp) # generated -add_vk_layer(Generic generic_layer.cpp vk_layer_table.cpp) -add_vk_layer(APIDump api_dump.cpp vk_layer_table.cpp) -add_vk_layer(ObjectTracker object_track.cpp vk_layer_table.cpp) -add_vk_layer(Threading threading.cpp vk_layer_table.cpp) +add_vk_layer(generic generic_layer.cpp vk_layer_table.cpp) +add_vk_layer(api_dump api_dump.cpp vk_layer_table.cpp) +add_vk_layer(object_tracker object_tracker.cpp vk_layer_table.cpp) +add_vk_layer(threading threading.cpp vk_layer_table.cpp) diff --git a/layers/README.md b/layers/README.md index bd7a50d9..8c7411ad 100644 --- a/layers/README.md +++ b/layers/README.md @@ -31,51 +31,51 @@ Note that some layers are code-generated and will therefore exist in the directo -include/vkLayer.h - header file for layer code. ### Templates -layers/basic.cpp (name=VK_LAYER_LUNARG_Basic) simple example wrapping a few entrypoints. Shows layer features: +layers/basic.cpp (name=VK_LAYER_LUNARG_basic) simple example wrapping a few entrypoints. Shows layer features: - Multiple dispatch tables for supporting multiple GPUs. - Example layer extension function shown. - Layer extension advertised by vkGetXXXExtension(). layers/multi.cpp (name=VK_LAYER_LUNARG_multi1:VK_LAYER_LUNARG_multi2) simple example showing multiple layers per library -(build dir)/layer/generic_layer.cpp (name=VK_LAYER_LUNARG_Generic) - auto generated example wrapping all VK entrypoints. +(build dir)/layer/generic_layer.cpp (name=VK_LAYER_LUNARG_generic) - auto generated example wrapping all VK entrypoints. ### Layer Details For complete details of current validation layers, including all of the validation checks that they perform, please refer to the document layers/vk_validation_layer_details.md. Below is a brief overview of each layer. ### Print API Calls and Parameter Values -(build dir)/layers/api_dump.cpp (name=VK_LAYER_LUNARG_APIDump) - print out API calls along with parameter values +(build dir)/layers/api_dump.cpp (name=VK_LAYER_LUNARG_api_dump) - print out API calls along with parameter values ### Print Object Stats -(build dir)/layers/object_track.cpp (name=VK_LAYER_LUNARG_ObjectTracker) - Track object creation, use, and destruction. As objects are created, they're stored in a map. As objects are used, the layer verifies they exist in the map, flagging errors for unknown objects. As objects are destroyed, they're removed from the map. At vkDestroyDevice() and vkDestroyInstance() times, if any objects have not been destroyed, they are reported as leaked objects. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. +(build dir)/layers/object_tracker.cpp (name=VK_LAYER_LUNARG_object_tracker) - Track object creation, use, and destruction. As objects are created, they're stored in a map. As objects are used, the layer verifies they exist in the map, flagging errors for unknown objects. As objects are destroyed, they're removed from the map. At vkDestroyDevice() and vkDestroyInstance() times, if any objects have not been destroyed, they are reported as leaked objects. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. ### Validate Draw State and Shaders -layers/draw\_state.cpp (name=VK_LAYER_LUNARG_DrawState) - DrawState tracks the Descriptor Set, Pipeline State, Shaders, and dynamic state performing some point validation as states are created and used, and further validation at each Draw call. Of primary interest is making sure that the resources bound to Descriptor Sets correctly align with the layout specified for the Set. Additionally DrawState include sharder validation (formerly separate ShaderChecker layer) that inspects the SPIR-V shader images and fixed function pipeline stages at PSO creation time. It flags errors when inconsistencies are found across interfaces between shader stages. The exact behavior of the checks depends on the pair of pipeline stages involved. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. +layers/draw\_state.cpp (name=VK_LAYER_LUNARG_draw_state) - DrawState tracks the Descriptor Set, Pipeline State, Shaders, and dynamic state performing some point validation as states are created and used, and further validation at each Draw call. Of primary interest is making sure that the resources bound to Descriptor Sets correctly align with the layout specified for the Set. Additionally DrawState include sharder validation (formerly separate ShaderChecker layer) that inspects the SPIR-V shader images and fixed function pipeline stages at PSO creation time. It flags errors when inconsistencies are found across interfaces between shader stages. The exact behavior of the checks depends on the pair of pipeline stages involved. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. ### Track GPU Memory -layers/mem\_tracker.cpp (name=VK_LAYER_LUNARG_MemTracker) - The MemTracker layer tracks memory objects and references and validates that they are managed correctly by the application. This includes tracking object bindings, memory hazards, and memory object lifetimes. MemTracker validates several other hazard-related issues related to command buffers, fences, and memory mapping. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. +layers/mem\_tracker.cpp (name=VK_LAYER_LUNARG_mem_tracker) - The MemTracker layer tracks memory objects and references and validates that they are managed correctly by the application. This includes tracking object bindings, memory hazards, and memory object lifetimes. MemTracker validates several other hazard-related issues related to command buffers, fences, and memory mapping. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. ### Check parameters -layers/param_checker.cpp (name=VK_LAYER_LUNARG_ParamChecker) - Check the input parameters to API calls for validity. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. +layers/param_checker.cpp (name=VK_LAYER_LUNARG_param_checker) - Check the input parameters to API calls for validity. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. ### Image parameters -layers/image.cpp (name=VK_LAYER_LUNARG_Image) - The Image layer is intended to validate image parameters, formats, and correct use. Images are a significant enough area that they were given a separate layer. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. +layers/image.cpp (name=VK_LAYER_LUNARG_image) - The Image layer is intended to validate image parameters, formats, and correct use. Images are a significant enough area that they were given a separate layer. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. ### Check threading -/layers/threading.cpp (name=VK_LAYER_LUNARG_Threading) - Check multithreading of API calls for validity. Currently this checks that only one thread at a time uses an object in free-threaded API calls. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. +/layers/threading.cpp (name=VK_LAYER_LUNARG_threading) - Check multithreading of API calls for validity. Currently this checks that only one thread at a time uses an object in free-threaded API calls. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. ### Swapchain -/layer/swapchain.cpp (name=VK_LAYER_LUNARG_Swapchain) - Check that WSI extensions are being used correctly. +/layer/swapchain.cpp (name=VK_LAYER_LUNARG_swapchain) - Check that WSI extensions are being used correctly. ### Device Limitations -layers/device_limits.cpp (name=VK_LAYER_LUNARG_DeviceLimits) - This layer is intended to capture underlying device features and limitations and then flag errors if an app makes requests for unsupported features or exceeding limitations. This layer is a work in progress and currently only flags some high-level errors without flagging errors on specific feature and limitation. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. +layers/device_limits.cpp (name=VK_LAYER_LUNARG_device_limits) - This layer is intended to capture underlying device features and limitations and then flag errors if an app makes requests for unsupported features or exceeding limitations. This layer is a work in progress and currently only flags some high-level errors without flagging errors on specific feature and limitation. If a Dbg callback function is registered, this layer will use callback function(s) for reporting, otherwise uses stdout. ## Using Layers 1. Build VK loader and i965 icd driver using normal steps (cmake and make) -2. Place libVKLayer.so in the same directory as your VK test or app: +2. Place libVkLayer_.so in the same directory as your VK test or app: - cp build/layer/libVKLayerBasic.so build/layer/libVKLayerGeneric.so build/tests + cp build/layer/libVkLayer_basic.so build/layer/libVkLayer_generic.so build/tests This is required for the Loader to be able to scan and enumerate your library. Alternatively, use the VK\_LAYER\_PATH environment variable to specify where the layer libraries reside. @@ -87,8 +87,8 @@ layers/device_limits.cpp (name=VK_LAYER_LUNARG_DeviceLimits) - This layer is int 4. Specify which Layers to activate by using vkCreateDevice and/or vkCreateInstance or environment variables. - export VK\_INSTANCE\_LAYERS=VK_LAYER_LUNARG_Basic:VK_LAYER_LUNARG_Generic - export VK\_DEVICE\_LAYERS=VK_LAYER_LUNARG_Basic:VK_LAYER_LUNARG_Generic + export VK\_INSTANCE\_LAYERS=VK_LAYER_LUNARG_basic:VK_LAYER_LUNARG_generic + export VK\_DEVICE\_LAYERS=VK_LAYER_LUNARG_basic:VK_LAYER_LUNARG_generic cd build/tests; ./vkinfo ## Tips for writing new layers @@ -104,7 +104,7 @@ vkCreateDevice and/or vkCreateInstance or environment variables. implementation; exceptions are vkGetXXXXProcAddr, which must have the correct name since the Loader calls these entrypoints; 8. entrypoint names must be exported to the OSes dynamic loader with VK\_LAYER\_EXPORT; -9. Layer naming convention is camel case same name as in library: libVKLayer.so +9. Layer naming convention is camel case same name as in library: libVkLayer_.so 10. For multiple layers in one library the manifest file can specify each layer. ## Status diff --git a/layers/apidump.h b/layers/api_dump.h similarity index 98% rename from layers/apidump.h rename to layers/api_dump.h index ce49431d..5675233d 100644 --- a/layers/apidump.h +++ b/layers/api_dump.h @@ -30,7 +30,7 @@ #include "vulkan/vk_layer.h" /* - * This file contains static functions for the generated layer Generic + * This file contains static functions for the generated layer api_dump */ #define LAYER_PROPS_ARRAY_SIZE 1 @@ -39,7 +39,7 @@ static const VkLayerProperties layerProps[LAYER_PROPS_ARRAY_SIZE] = { "VK_LAYER_LUNARG_api_dump", VK_API_VERSION, // specVersion VK_MAKE_VERSION(0, 1, 0), // implementationVersion - "layer: APIDump", + "layer: api_dump", } }; @@ -49,7 +49,7 @@ static const VkLayerProperties layerDevProps[LAYER_DEV_PROPS_ARRAY_SIZE] = { "VK_LAYER_LUNARG_api_dump", VK_API_VERSION, // specVersion VK_MAKE_VERSION(0, 1, 0), // implementationVersion - "layer: APIDump", + "layer: api_dump", } }; diff --git a/layers/basic.cpp b/layers/basic.cpp index 1e054759..ba56517b 100644 --- a/layers/basic.cpp +++ b/layers/basic.cpp @@ -34,10 +34,10 @@ static const VkLayerProperties globalLayerProps[] = { { - "Basic", + "basic", VK_API_VERSION, // specVersion VK_MAKE_VERSION(0, 1, 0), // implementationVersion - "layer: Basic", + "layer: basic", } }; @@ -54,7 +54,7 @@ static const VkLayerProperties basic_physicaldevice_layers[] = { "VK_LAYER_LUNARG_basic", VK_API_VERSION, VK_MAKE_VERSION(0, 1, 0), - "Sample layer: Basic, implements vkLayerExtension1", + "Sample layer: basic, implements vkLayerExtension1", } }; diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index fc42886d..34837086 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -2887,7 +2887,7 @@ static const VkLayerProperties ds_global_layers[] = { "VK_LAYER_LUNARG_draw_state", VK_API_VERSION, VK_MAKE_VERSION(0, 1, 0), - "Validation layer: DrawState", + "Validation layer: draw_state", } }; @@ -2909,10 +2909,10 @@ static const VkExtensionProperties ds_device_extensions[] = { static const VkLayerProperties ds_device_layers[] = { { - "DrawState", + "draw_state", VK_API_VERSION, VK_MAKE_VERSION(0, 1, 0), - "Validation layer: DrawState", + "Validation layer: draw_state", } }; diff --git a/layers/generic.h b/layers/generic.h index 955ea7d6..bc5c555c 100644 --- a/layers/generic.h +++ b/layers/generic.h @@ -31,7 +31,7 @@ #include "vulkan/vk_layer.h" /* - * This file contains static functions for the generated layer Generic + * This file contains static functions for the generated layer generic */ // The following is for logging error messages: @@ -50,7 +50,7 @@ static const VkLayerProperties globalLayerProps[] = { "VK_LAYER_LUNARG_generic", VK_API_VERSION, // specVersion VK_MAKE_VERSION(0, 1, 0), // implementationVersion - "layer: Generic", + "layer: generic", } }; @@ -59,7 +59,7 @@ static const VkLayerProperties deviceLayerProps[] = { "VK_LAYER_LUNARG_generic", VK_API_VERSION, // specVersion VK_MAKE_VERSION(0, 1, 0), // implementationVersion - "layer: Generic", + "layer: generic", } }; diff --git a/layers/image.cpp b/layers/image.cpp index a3acbc88..0b38d4ac 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -225,7 +225,7 @@ static const VkLayerProperties pc_global_layers[] = { "VK_LAYER_LUNARG_image", VK_API_VERSION, VK_MAKE_VERSION(0, 1, 0), - "Validation layer: Image", + "Validation layer: image", } }; diff --git a/layers/windows/api_dump.json b/layers/linux/VkLayer_api_dump.json similarity index 68% rename from layers/windows/api_dump.json rename to layers/linux/VkLayer_api_dump.json index db86b69c..adc2091b 100644 --- a/layers/windows/api_dump.json +++ b/layers/linux/VkLayer_api_dump.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_APIDump", + "name": "VK_LAYER_LUNARG_api_dump", "type": "GLOBAL", - "library_path": ".\\VKLayerAPIDump.dll", + "library_path": "./libVkLayer_api_dump.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG debug layer" diff --git a/layers/linux/basic.json b/layers/linux/VkLayer_basic.json similarity index 82% rename from layers/linux/basic.json rename to layers/linux/VkLayer_basic.json index 28e00f56..227b1f4e 100644 --- a/layers/linux/basic.json +++ b/layers/linux/VkLayer_basic.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Basic", + "name": "VK_LAYER_LUNARG_basic", "type": "GLOBAL", - "library_path": "./libVKLayerBasic.so", + "library_path": "./libVkLayer_basic.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Sample Layer", diff --git a/layers/linux/basic_implicit.json b/layers/linux/VkLayer_basic_implicit.json similarity index 81% rename from layers/linux/basic_implicit.json rename to layers/linux/VkLayer_basic_implicit.json index f8b8a67a..396b4859 100644 --- a/layers/linux/basic_implicit.json +++ b/layers/linux/VkLayer_basic_implicit.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Basic", + "name": "VK_LAYER_LUNARG_basic", "type": "GLOBAL", - "library_path": "/etc/vulkan/implicit_layer.d/libVKLayerBasic.so", + "library_path": "/etc/vulkan/implicit_layer.d/libVkLayer_basic.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Sample Layer", diff --git a/layers/linux/VkLayer_device_limits.json b/layers/linux/VkLayer_device_limits.json new file mode 100644 index 00000000..b26cffe8 --- /dev/null +++ b/layers/linux/VkLayer_device_limits.json @@ -0,0 +1,17 @@ +{ + "file_format_version" : "1.0.0", + "layer" : { + "name": "VK_LAYER_LUNARG_device_limits", + "type": "GLOBAL", + "library_path": "./libVkLayer_device_limits.so", + "api_version": "0.210.0", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "2" + } + ] + } +} diff --git a/layers/linux/draw_state.json b/layers/linux/VkLayer_draw_state.json similarity index 85% rename from layers/linux/draw_state.json rename to layers/linux/VkLayer_draw_state.json index 49c7d3b9..71504afb 100644 --- a/layers/linux/draw_state.json +++ b/layers/linux/VkLayer_draw_state.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_DrawState", + "name": "VK_LAYER_LUNARG_draw_state", "type": "GLOBAL", - "library_path": "./libVKLayerDrawState.so", + "library_path": "./libVkLayer_draw_state.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/windows/generic.json b/layers/linux/VkLayer_generic.json similarity index 68% rename from layers/windows/generic.json rename to layers/linux/VkLayer_generic.json index 44ec1245..fa2bc3df 100644 --- a/layers/windows/generic.json +++ b/layers/linux/VkLayer_generic.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Generic", + "name": "VK_LAYER_LUNARG_generic", "type": "GLOBAL", - "library_path": "./libVKLayerGeneric.so", + "library_path": "./libVkLayer_generic.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Sample Layer" diff --git a/layers/windows/image.json b/layers/linux/VkLayer_image.json similarity index 80% rename from layers/windows/image.json rename to layers/linux/VkLayer_image.json index 2347766f..20651a3d 100644 --- a/layers/windows/image.json +++ b/layers/linux/VkLayer_image.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Image", + "name": "VK_LAYER_LUNARG_image", "type": "GLOBAL", - "library_path": ".\\VKLayerImage.dll", + "library_path": "./libVkLayer_image.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/linux/VkLayer_mem_tracker.json b/layers/linux/VkLayer_mem_tracker.json new file mode 100644 index 00000000..4d14d04b --- /dev/null +++ b/layers/linux/VkLayer_mem_tracker.json @@ -0,0 +1,17 @@ +{ + "file_format_version" : "1.0.0", + "layer" : { + "name": "VK_LAYER_LUNARG_mem_tracker", + "type": "GLOBAL", + "library_path": "./libVkLayer_mem_tracker.so", + "api_version": "0.210.0", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "2" + } + ] + } +} diff --git a/layers/linux/multi.json b/layers/linux/VkLayer_multi.json similarity index 87% rename from layers/linux/multi.json rename to layers/linux/VkLayer_multi.json index 610b3028..1ff35825 100644 --- a/layers/linux/multi.json +++ b/layers/linux/VkLayer_multi.json @@ -3,7 +3,7 @@ "layer" : { "name": "VK_LAYER_LUNARG_multi1", "type": "DEVICE", - "library_path": "./libVKLayerMulti.so", + "library_path": "./libVkLayer_multi.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Sample multiple layer per library", @@ -14,7 +14,7 @@ "layer" : { "name": "VK_LUNARG_multi2", "type": "INSTANCE", - "library_path": "./libVKLayerMulti.so", + "library_path": "./libVkLayer_multi.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Sample multiple layer per library", diff --git a/layers/linux/VkLayer_object_tracker.json b/layers/linux/VkLayer_object_tracker.json new file mode 100644 index 00000000..026630d6 --- /dev/null +++ b/layers/linux/VkLayer_object_tracker.json @@ -0,0 +1,17 @@ +{ + "file_format_version" : "1.0.0", + "layer" : { + "name": "VK_LAYER_LUNARG_object_tracker", + "type": "GLOBAL", + "library_path": "./libVkLayer_object_tracker.so", + "api_version": "0.210.0", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "2" + } + ] + } +} diff --git a/layers/linux/VkLayer_param_checker.json b/layers/linux/VkLayer_param_checker.json new file mode 100644 index 00000000..c0c07161 --- /dev/null +++ b/layers/linux/VkLayer_param_checker.json @@ -0,0 +1,17 @@ +{ + "file_format_version" : "1.0.0", + "layer" : { + "name": "VK_LAYER_LUNARG_param_checker", + "type": "GLOBAL", + "library_path": "./libVkLayer_param_checker.so", + "api_version": "0.210.0", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "2" + } + ] + } +} diff --git a/layers/windows/screenshot.json b/layers/linux/VkLayer_screenshot.json similarity index 68% rename from layers/windows/screenshot.json rename to layers/linux/VkLayer_screenshot.json index 3de92118..020f8374 100644 --- a/layers/windows/screenshot.json +++ b/layers/linux/VkLayer_screenshot.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_ScreenShot", + "name": "VK_LAYER_LUNARG_screenshot", "type": "GLOBAL", - "library_path": ".\\VKLayerScreenShot.dll", + "library_path": "./libVkLayer_screenshot.so", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG image capture layer" diff --git a/layers/linux/VkLayer_swapchain.json b/layers/linux/VkLayer_swapchain.json new file mode 100644 index 00000000..dc9e15a9 --- /dev/null +++ b/layers/linux/VkLayer_swapchain.json @@ -0,0 +1,17 @@ +{ + "file_format_version" : "1.0.0", + "layer" : { + "name": "VK_LAYER_LUNARG_swapchain", + "type": "GLOBAL", + "library_path": "./libVkLayer_swapchain.so", + "api_version": "0.210.0", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "2" + } + ] + } +} diff --git a/layers/linux/VkLayer_threading.json b/layers/linux/VkLayer_threading.json new file mode 100644 index 00000000..6e4b0336 --- /dev/null +++ b/layers/linux/VkLayer_threading.json @@ -0,0 +1,17 @@ +{ + "file_format_version" : "1.0.0", + "layer" : { + "name": "VK_LAYER_LUNARG_threading", + "type": "GLOBAL", + "library_path": "./libVkLayer_threading.so", + "api_version": "0.210.0", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "2" + } + ] + } +} diff --git a/layers/linux/param_checker.json b/layers/linux/param_checker.json deleted file mode 100644 index 305e79b5..00000000 --- a/layers/linux/param_checker.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "file_format_version" : "1.0.0", - "layer" : { - "name": "VK_LAYER_LUNARG_ParamChecker", - "type": "GLOBAL", - "library_path": "./libVKLayerParamChecker.so", - "api_version": "0.210.0", - "implementation_version": "1", - "description": "LunarG Validation Layer", - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "2" - } - ] - } -} diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp index d3e9a92a..e2ac7945 100644 --- a/layers/mem_tracker.cpp +++ b/layers/mem_tracker.cpp @@ -1240,7 +1240,7 @@ static const VkLayerProperties mtGlobalLayers[] = { "VK_LAYER_LUNARG_mem_tracker", VK_API_VERSION, VK_MAKE_VERSION(0, 1, 0), - "Validation layer: MemTracker", + "Validation layer: mem_tracker", } }; diff --git a/layers/object_track.h b/layers/object_tracker.h similarity index 95% rename from layers/object_track.h rename to layers/object_tracker.h index 82b6c506..4783a474 100644 --- a/layers/object_track.h +++ b/layers/object_tracker.h @@ -93,8 +93,8 @@ struct instExts { static std::unordered_map instanceExtMap; static std::unordered_map layer_data_map; -static device_table_map ObjectTracker_device_table_map; -static instance_table_map ObjectTracker_instance_table_map; +static device_table_map object_tracker_device_table_map; +static instance_table_map object_tracker_instance_table_map; // We need additionally validate image usage using a separate map // of swapchain-created images @@ -185,7 +185,7 @@ static inline const char* string_VkDebugReportObjectTypeEXT(VkDebugReportObjectT static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo, VkDevice device) { layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); - VkLayerDispatchTable *pDisp = get_dispatch_table(ObjectTracker_device_table_map, device); + VkLayerDispatchTable *pDisp = get_dispatch_table(object_tracker_device_table_map, device); PFN_vkGetDeviceProcAddr gpa = pDisp->GetDeviceProcAddr; pDisp->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR) gpa(device, "vkCreateSwapchainKHR"); pDisp->DestroySwapchainKHR = (PFN_vkDestroySwapchainKHR) gpa(device, "vkDestroySwapchainKHR"); @@ -205,7 +205,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo static void createInstanceRegisterExtensions(const VkInstanceCreateInfo* pCreateInfo, VkInstance instance) { uint32_t i; - VkLayerInstanceDispatchTable *pDisp = get_dispatch_table(ObjectTracker_instance_table_map, instance); + VkLayerInstanceDispatchTable *pDisp = get_dispatch_table(object_tracker_instance_table_map, instance); PFN_vkGetInstanceProcAddr gpa = pDisp->GetInstanceProcAddr; pDisp->GetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceSupportKHR"); pDisp->GetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); @@ -762,7 +762,7 @@ explicit_CreateInstance( VkInstance * pInstance) { - VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(ObjectTracker_instance_table_map, *pInstance); + VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(object_tracker_instance_table_map, *pInstance); VkResult result = pInstanceTable->CreateInstance(pCreateInfo, pAllocator, pInstance); if (result == VK_SUCCESS) { @@ -786,7 +786,7 @@ explicit_GetPhysicalDeviceQueueFamilyProperties( uint32_t* pCount, VkQueueFamilyProperties* pProperties) { - get_dispatch_table(ObjectTracker_instance_table_map, gpu)->GetPhysicalDeviceQueueFamilyProperties(gpu, pCount, pProperties); + get_dispatch_table(object_tracker_instance_table_map, gpu)->GetPhysicalDeviceQueueFamilyProperties(gpu, pCount, pProperties); loader_platform_thread_lock_mutex(&objLock); if (pProperties != NULL) @@ -802,12 +802,10 @@ explicit_CreateDevice( VkDevice *pDevice) { loader_platform_thread_lock_mutex(&objLock); -// VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(ObjectTracker_instance_table_map, gpu); - VkLayerDispatchTable *pDeviceTable = get_dispatch_table(ObjectTracker_device_table_map, *pDevice); + VkLayerDispatchTable *pDeviceTable = get_dispatch_table(object_tracker_device_table_map, *pDevice); VkResult result = pDeviceTable->CreateDevice(gpu, pCreateInfo, pAllocator, pDevice); if (result == VK_SUCCESS) { layer_data *my_instance_data = get_my_data_ptr(get_dispatch_key(gpu), layer_data_map); - //// VkLayerDispatchTable *pTable = get_dispatch_table(ObjectTracker_device_table_map, *pDevice); layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice); create_device(*pDevice, *pDevice, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT); @@ -826,7 +824,7 @@ VkResult explicit_EnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysi loader_platform_thread_unlock_mutex(&objLock); if (skipCall) return VK_ERROR_VALIDATION_FAILED_EXT; - VkResult result = get_dispatch_table(ObjectTracker_instance_table_map, instance)->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); + VkResult result = get_dispatch_table(object_tracker_instance_table_map, instance)->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); loader_platform_thread_lock_mutex(&objLock); if (result == VK_SUCCESS) { if (pPhysicalDevices) { @@ -850,7 +848,7 @@ explicit_GetDeviceQueue( validate_device(device, device); loader_platform_thread_unlock_mutex(&objLock); - get_dispatch_table(ObjectTracker_device_table_map, device)->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); + get_dispatch_table(object_tracker_device_table_map, device)->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); loader_platform_thread_lock_mutex(&objLock); addQueueInfo(queueNodeIndex, *pQueue); @@ -875,7 +873,7 @@ explicit_MapMemory( if (skipCall == VK_TRUE) return VK_ERROR_VALIDATION_FAILED_EXT; - VkResult result = get_dispatch_table(ObjectTracker_device_table_map, device)->MapMemory(device, mem, offset, size, flags, ppData); + VkResult result = get_dispatch_table(object_tracker_device_table_map, device)->MapMemory(device, mem, offset, size, flags, ppData); return result; } @@ -893,7 +891,7 @@ explicit_UnmapMemory( if (skipCall == VK_TRUE) return; - get_dispatch_table(ObjectTracker_device_table_map, device)->UnmapMemory(device, mem); + get_dispatch_table(object_tracker_device_table_map, device)->UnmapMemory(device, mem); } VkResult @@ -917,7 +915,7 @@ explicit_QueueBindSparse( loader_platform_thread_unlock_mutex(&objLock); - VkResult result = get_dispatch_table(ObjectTracker_device_table_map, queue)->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); + VkResult result = get_dispatch_table(object_tracker_device_table_map, queue)->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); return result; } @@ -937,7 +935,7 @@ explicit_AllocateCommandBuffers( return VK_ERROR_VALIDATION_FAILED_EXT; } - VkResult result = get_dispatch_table(ObjectTracker_device_table_map, device)->AllocateCommandBuffers( + VkResult result = get_dispatch_table(object_tracker_device_table_map, device)->AllocateCommandBuffers( device, pAllocateInfo, pCommandBuffers); loader_platform_thread_lock_mutex(&objLock); @@ -966,7 +964,7 @@ explicit_AllocateDescriptorSets( if (skipCall) return VK_ERROR_VALIDATION_FAILED_EXT; - VkResult result = get_dispatch_table(ObjectTracker_device_table_map, device)->AllocateDescriptorSets( + VkResult result = get_dispatch_table(object_tracker_device_table_map, device)->AllocateDescriptorSets( device, pAllocateInfo, pDescriptorSets); loader_platform_thread_lock_mutex(&objLock); @@ -990,7 +988,7 @@ explicit_FreeCommandBuffers( validate_device(device, device); loader_platform_thread_unlock_mutex(&objLock); - get_dispatch_table(ObjectTracker_device_table_map, device)->FreeCommandBuffers(device, + get_dispatch_table(object_tracker_device_table_map, device)->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); loader_platform_thread_lock_mutex(&objLock); @@ -1023,7 +1021,7 @@ explicit_DestroySwapchainKHR( destroy_swapchain(device, swapchain); loader_platform_thread_unlock_mutex(&objLock); - get_dispatch_table(ObjectTracker_device_table_map, device)->DestroySwapchainKHR(device, swapchain, pAllocator); + get_dispatch_table(object_tracker_device_table_map, device)->DestroySwapchainKHR(device, swapchain, pAllocator); } void @@ -1036,7 +1034,7 @@ explicit_FreeMemory( validate_device(device, device); loader_platform_thread_unlock_mutex(&objLock); - get_dispatch_table(ObjectTracker_device_table_map, device)->FreeMemory(device, mem, pAllocator); + get_dispatch_table(object_tracker_device_table_map, device)->FreeMemory(device, mem, pAllocator); loader_platform_thread_lock_mutex(&objLock); destroy_device_memory(device, mem); @@ -1054,7 +1052,7 @@ explicit_FreeDescriptorSets( validate_descriptor_pool(device, descriptorPool); validate_device(device, device); loader_platform_thread_unlock_mutex(&objLock); - VkResult result = get_dispatch_table(ObjectTracker_device_table_map, device)->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets); + VkResult result = get_dispatch_table(object_tracker_device_table_map, device)->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets); loader_platform_thread_lock_mutex(&objLock); for (uint32_t i=0; iDestroyDescriptorPool(device, descriptorPool, pAllocator); + get_dispatch_table(object_tracker_device_table_map, device)->DestroyDescriptorPool(device, descriptorPool, pAllocator); } void @@ -1124,7 +1122,7 @@ explicit_DestroyCommandPool( } destroy_command_pool(device, commandPool); loader_platform_thread_unlock_mutex(&objLock); - get_dispatch_table(ObjectTracker_device_table_map, device)->DestroyCommandPool(device, commandPool, pAllocator); + get_dispatch_table(object_tracker_device_table_map, device)->DestroyCommandPool(device, commandPool, pAllocator); } VkResult @@ -1141,7 +1139,7 @@ explicit_GetSwapchainImagesKHR( if (skipCall) return VK_ERROR_VALIDATION_FAILED_EXT; - VkResult result = get_dispatch_table(ObjectTracker_device_table_map, device)->GetSwapchainImagesKHR(device, swapchain, pCount, pSwapchainImages); + VkResult result = get_dispatch_table(object_tracker_device_table_map, device)->GetSwapchainImagesKHR(device, swapchain, pCount, pSwapchainImages); if (pSwapchainImages != NULL) { loader_platform_thread_lock_mutex(&objLock); diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp index dcf244ef..ddc0420b 100644 --- a/layers/param_checker.cpp +++ b/layers/param_checker.cpp @@ -181,10 +181,10 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionPrope static const VkLayerProperties pc_global_layers[] = { { - "ParamChecker", + "param_checker", VK_API_VERSION, VK_MAKE_VERSION(0, 1, 0), - "Validation layer: ParamChecker", + "Validation layer: param_checker", } }; diff --git a/layers/screenshot.cpp b/layers/screenshot.cpp index 202cb855..fe4b770f 100644 --- a/layers/screenshot.cpp +++ b/layers/screenshot.cpp @@ -384,10 +384,10 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices( static const VkLayerProperties ss_device_layers[] = { { - "ScreenShot", + "screenshot", VK_API_VERSION, VK_MAKE_VERSION(0, 1, 0), - "Layer: ScreenShot", + "Layer: screenshot", } }; diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 255fb1d5..a60ed206 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -58,10 +58,10 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionPrope static const VkLayerProperties swapchain_global_layers[] = { { - "Swapchain", + "swapchain", VK_API_VERSION, VK_MAKE_VERSION(0, 1, 0), - "Validation layer: Swapchain", + "Validation layer: swapchain", } }; diff --git a/layers/swapchain.h b/layers/swapchain.h index 21585d9b..2b5a333e 100644 --- a/layers/swapchain.h +++ b/layers/swapchain.h @@ -40,7 +40,7 @@ static const VkLayerProperties globalLayerProps[] = { "VK_LAYER_LUNARG_swapchain", VK_API_VERSION, // specVersion VK_MAKE_VERSION(0, 1, 0), // implementationVersion - "layer: Swapchain", + "layer: swapchain", } }; @@ -49,7 +49,7 @@ static const VkLayerProperties deviceLayerProps[] = { "VK_LAYER_LUNARG_swapchain", VK_API_VERSION, // specVersion VK_MAKE_VERSION(0, 1, 0), // implementationVersion - "layer: Swapchain", + "layer: swapchain", } }; diff --git a/layers/threading.h b/layers/threading.h index 2d909b17..f3ceabce 100644 --- a/layers/threading.h +++ b/layers/threading.h @@ -47,8 +47,8 @@ struct layer_data { }; static std::unordered_map layer_data_map; -static device_table_map Threading_device_table_map; -static instance_table_map Threading_instance_table_map; +static device_table_map threading_device_table_map; +static instance_table_map threading_instance_table_map; static inline debug_report_data *mdd(const void* object) { diff --git a/layers/vk_layer_settings.txt b/layers/vk_layer_settings.txt index 5634c9b7..ae02457e 100644 --- a/layers/vk_layer_settings.txt +++ b/layers/vk_layer_settings.txt @@ -33,57 +33,57 @@ # # Example of actual settings for each layer # -# VK_LUNARG_LAYER_DeviceLimits Settings +# VK_LUNARG_LAYER_device_limits Settings DeviceLimitsDebugAction = VK_DBG_LAYER_ACTION_LOG_MSG DeviceLimitsReportFlags = error,warn,perf DeviceLimitsLogFilename = stdout -# VK_LUNARG_LAYER_DrawState Settings +# VK_LUNARG_LAYER_draw_state Settings DrawStateDebugAction = VK_DBG_LAYER_ACTION_LOG_MSG DrawStateReportFlags = error,warn,perf DrawStateLogFilename = stdout -# VK_LUNARG_LAYER_Image Settings +# VK_LUNARG_LAYER_image Settings ImageDebugAction = VK_DBG_LAYER_ACTION_LOG_MSG ImageReportFlags = error,warn,perf ImageLogFilename = stdout -# VK_LUNARG_LAYER_MemTracker Settings +# VK_LUNARG_LAYER_mem_tracker Settings MemTrackerDebugAction = VK_DBG_LAYER_ACTION_LOG_MSG MemTrackerReportFlags = error,warn,perf MemTrackerLogFilename = stdout -# VK_LUNARG_LAYER_ObjectTracker Settings +# VK_LUNARG_LAYER_object_tracker Settings ObjectTrackerDebugAction = VK_DBG_LAYER_ACTION_LOG_MSG ObjectTrackerReportFlags = error,warn,perf ObjectTrackerLogFilename = stdout -# VK_LUNARG_LAYER_ParamChecker Settings +# VK_LUNARG_LAYER_param_checker Settings ParamCheckerDebugAction = VK_DBG_LAYER_ACTION_LOG_MSG ParamCheckerReportFlags = error,warn,perf ParamCheckerLogFilename = stdout -# VK_LUNARG_LAYER_Swapchain Settings +# VK_LUNARG_LAYER_swapchain Settings SwapchainDebugAction = VK_DBG_LAYER_ACTION_LOG_MSG SwapchainReportFlags = error,warn,perf SwapchainLogFilename = stdout -# VK_LUNARG_LAYER_Threading Settings +# VK_LUNARG_LAYER_threading Settings ThreadingDebugAction = VK_DBG_LAYER_ACTION_LOG_MSG ThreadingReportFlags = error,warn,perf ThreadingLogFilename = stdout -# VK_LUNARG_LAYER_APIDump Settings - NOTE that VK_LUNARG_LAYER_APIDump is +# VK_LUNARG_LAYER_api_dump Settings - NOTE that VK_LUNARG_LAYER_api_dump is # not a validation layer and the common settings for ReportFlags and # DebugAction do not apply # Detailed TRUE causes parameter details to be dumped in addition to API calls -APIDumpDetailed = TRUE +ApiDumpDetailed = TRUE # NoAddr TRUE causes "address" to be dumped in place of hex addresses -APIDumpNoAddr = FALSE +ApiDumpNoAddr = FALSE # File = TRUE indicates that output should be written to file instead of STDOUT -APIDumpFile = FALSE +ApiDumpFile = FALSE # LogFilename is file to dump to when "File = TRUE" default is "vk_apidump.txt" -APIDumpLogFilename = stdout +ApiDumpLogFilename = stdout # Flush = TRUE causes IO to be flushed after each line that's written -APIDumpFlush = FALSE +ApiDumpFlush = FALSE diff --git a/layers/vk_validation_layer_details.md b/layers/vk_validation_layer_details.md index e2e0f89a..3017e92a 100644 --- a/layers/vk_validation_layer_details.md +++ b/layers/vk_validation_layer_details.md @@ -2,13 +2,13 @@ # Validation Layer Details -## VK_LAYER_LUNARG_DrawState +## VK_LAYER_LUNARG_draw_state -### VK_LAYER_LUNARG_DrawState Overview +### VK_LAYER_LUNARG_draw_state Overview -The VK_LAYER_LUNARG_DrawState layer tracks state leading into Draw cmds. This includes the Pipeline state, dynamic state, shaders, and descriptor set state. VK_LAYER_LUNARG_DrawState validates the consistency and correctness between and within these states. VK_LAYER_LUNARG_DrawState also includes SPIR-V validation which functionality is recorded under the VK_LAYER_LUNARG_ShaderChecker section below. +The VK_LAYER_LUNARG_draw_state layer tracks state leading into Draw cmds. This includes the Pipeline state, dynamic state, shaders, and descriptor set state. VK_LAYER_LUNARG_draw_state validates the consistency and correctness between and within these states. VK_LAYER_LUNARG_draw_state also includes SPIR-V validation which functionality is recorded under the VK_LAYER_LUNARG_ShaderChecker section below. -### VK_LAYER_LUNARG_DrawState Details Table +### VK_LAYER_LUNARG_draw_state Details Table | Check | Overview | ENUM DRAWSTATE_* | Relevant API | Testname | Notes/TODO | | ----- | -------- | ---------------- | ------------ | -------- | ---------- | @@ -16,8 +16,8 @@ The VK_LAYER_LUNARG_DrawState layer tracks state leading into Draw cmds. This in | Validate DbgMarker exensions | Validates that DbgMarker extensions have been enabled before use | INVALID_EXTENSION | vkCmdDbgMarkerBegin vkCmdDbgMarkerEnd | TBD | None | | Valid BeginCommandBuffer state | Must not call Begin on command buffers that are being recorded, and primary command buffers must specify VK_NULL_HANDLE for RenderPass or Framebuffer parameters, while secondary command buffers must provide non-null parameters, | BEGIN_CB_INVALID_STATE | vkBeginCommandBuffer | PrimaryCommandBufferFramebufferAndRenderpass SecondaryCommandBufferFramebufferAndRenderpass | None | | Valid Command Buffer Reset | Can only reset individual command buffer that was allocated from a pool with VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT set | INVALID_COMMAND_BUFFER_RESET | vkBeginCommandBuffer vkResetCommandBuffer | CommandBufferResetErrors | None | -| PSO Bound | Verify that a properly created and valid pipeline object is bound to the CommandBuffer specified in these calls | NO_PIPELINE_BOUND | vkCmdBindDescriptorSets vkCmdBindVertexBuffers | PipelineNotBound | This check is currently more related to VK_LAYER_LUNARG_DrawState data structures and less about verifying that PSO is bound at all appropriate points in API. For API purposes, need to make sure this is checked at Draw time and any other relevant calls. | -| Valid DescriptorPool | Verifies that the descriptor set pool object was properly created and is valid | INVALID_POOL | vkResetDescriptorPool vkAllocateDescriptorSets | None | This is just an internal layer data structure check. VK_LAYER_LUNARG_ParamChecker or VK_LAYER_LUNARG_ObjectTracker should really catch bad DSPool | +| PSO Bound | Verify that a properly created and valid pipeline object is bound to the CommandBuffer specified in these calls | NO_PIPELINE_BOUND | vkCmdBindDescriptorSets vkCmdBindVertexBuffers | PipelineNotBound | This check is currently more related to VK_LAYER_LUNARG_draw_state data structures and less about verifying that PSO is bound at all appropriate points in API. For API purposes, need to make sure this is checked at Draw time and any other relevant calls. | +| Valid DescriptorPool | Verifies that the descriptor set pool object was properly created and is valid | INVALID_POOL | vkResetDescriptorPool vkAllocateDescriptorSets | None | This is just an internal layer data structure check. VK_LAYER_LUNARG_param_checker or VK_LAYER_LUNARG_object_tracker should really catch bad DSPool | | Valid DescriptorSet | Validate that descriptor set was properly created and is currently valid | INVALID_SET | vkCmdBindDescriptorSets | None | Is this needed other places (like Update/Clear descriptors) | | Valid DescriptorSetLayout | Flag DescriptorSetLayout object that was not properly created | INVALID_LAYOUT | vkAllocateDescriptorSets | None | Anywhere else to check this? | | Valid Pipeline | Flag VkPipeline object that was not properly created | INVALID_PIPELINE | vkCmdBindPipeline | InvalidPipeline | NA | @@ -57,7 +57,7 @@ The VK_LAYER_LUNARG_DrawState layer tracks state leading into Draw cmds. This in | Correct Clear Use | Warn user if CmdClear for Color or DepthStencil issued to Cmd Buffer prior to a Draw Cmd. RenderPass LOAD_OP_CLEAR is preferred in this case. | CLEAR_CMD_BEFORE_DRAW | vkCmdClearColorImage vkCmdClearDepthStencilImage | ClearCmdNoDraw | NA | | Index Buffer Binding | Verify that an index buffer is bound at the point when an indexed draw is attempted. | INDEX_BUFFER_NOT_BOUND | vkCmdDrawIndexed vkCmdDrawIndexedIndirect | TODO | Implement validation test | | Viewport and Scissors match | In PSO viewportCount and scissorCount must match. Also for each count that is non-zero, there corresponding data array ptr should be non-NULL. | VIEWPORT_SCISSOR_MISMATCH | vkCreateGraphicsPipelines vkCmdSetViewport vkCmdSetScissor | TODO | Implement validation test | -| Valid Image Aspects for descriptor Updates | When updating ImageView for Descriptor Sets with layout of DEPTH_STENCIL type, the Image Aspect must not have both the DEPTH and STENCIL aspects set, but must have one of the two set. For COLOR_ATTACHMENT, aspect must have COLOR_BIT set. | INVALID_IMAGE_ASPECT | vkUpdateDescriptorSets | DepthStencilImageViewWithColorAspectBitError | This test hits Image layer error, but tough to create case that that skips that error and gets to VK_LAYER_LUNARG_DrawState error. | +| Valid Image Aspects for descriptor Updates | When updating ImageView for Descriptor Sets with layout of DEPTH_STENCIL type, the Image Aspect must not have both the DEPTH and STENCIL aspects set, but must have one of the two set. For COLOR_ATTACHMENT, aspect must have COLOR_BIT set. | INVALID_IMAGE_ASPECT | vkUpdateDescriptorSets | DepthStencilImageViewWithColorAspectBitError | This test hits Image layer error, but tough to create case that that skips that error and gets to VK_LAYER_LUNARG_draw_state error. | | Valid sampler descriptor Updates | An invalid sampler is used when updating SAMPLER descriptor. | SAMPLER_DESCRIPTOR_ERROR | vkUpdateDescriptorSets | SampleDescriptorUpdateError | Currently only making sure sampler handle is known, can add further validation for sampler parameters | | Immutable sampler update consistency | Within a single write update, all sampler updates must use either immutable samplers or non-immutable samplers, but not a combination of both. | INCONSISTENT_IMMUTABLE_SAMPLER_UPDATE | vkUpdateDescriptorSets | None | Write a test for this case | | Valid imageView descriptor Updates | An invalid imageView is used when updating *_IMAGE or *_ATTACHMENT descriptor. | IMAGEVIEW_DESCRIPTOR_ERROR | vkUpdateDescriptorSets | ImageViewDescriptorUpdateError | Currently only making sure imageView handle is known, can add further validation for imageView and underlying image parameters | @@ -68,11 +68,11 @@ The VK_LAYER_LUNARG_DrawState layer tracks state leading into Draw cmds. This in | Verify Memory Access Flags/Memory Barriers | Validate correct access flags for memory barriers | INVALID_BARRIER | vkCmdWaitEvents VkCmdPipelineBarrier | TBD | None | | NA | Enum used for informational messages | NONE | | NA | None | | NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | NA | None | -| NA | Enum used when VK_LAYER_LUNARG_Drawstate attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | NA | None | -| NA | Enum used when VK_LAYER_LUNARG_Drawstate attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | NA | None | +| NA | Enum used when VK_LAYER_LUNARG_draw_state attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | NA | None | +| NA | Enum used when VK_LAYER_LUNARG_draw_state attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | NA | None | -### VK_LAYER_LUNARG_DrawState Pending Work -Additional checks to be added to VK_LAYER_LUNARG_DrawState +### VK_LAYER_LUNARG_draw_state Pending Work +Additional checks to be added to VK_LAYER_LUNARG_draw_state 7. Lifetime validation (See [bug 13383](https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13383)) 8. XGL_DESCRIPTOR_SET @@ -99,7 +99,7 @@ Additional checks to be added to VK_LAYER_LUNARG_DrawState ### VK_LAYER_LUNARG_ShaderChecker Overview -The VK_LAYER_LUNARG_ShaderChecker functionality is part of VK_LAYER_LUNARG_DrawState layer and it inspects the SPIR-V shader images and fixed function pipeline stages at PSO creation time. +The VK_LAYER_LUNARG_ShaderChecker functionality is part of VK_LAYER_LUNARG_draw_state layer and it inspects the SPIR-V shader images and fixed function pipeline stages at PSO creation time. It flags errors when inconsistencies are found across interfaces between shader stages. The exact behavior of the checks depends on the pair of pipeline stages involved. @@ -122,13 +122,13 @@ depends on the pair of pipeline stages involved. - Additional test cases for variously broken SPIRV images - Validation of a single SPIRV image in isolation (the spec describes many constraints) -## VK_LAYER_LUNARG_ParamChecker +## VK_LAYER_LUNARG_param_checker -### VK_LAYER_LUNARG_ParamChecker Overview +### VK_LAYER_LUNARG_param_checker Overview -The VK_LAYER_LUNARG_ParamChecker layer validates parameter values and flags errors for any values that are outside of acceptable values for the given parameter. +The VK_LAYER_LUNARG_param_checker layer validates parameter values and flags errors for any values that are outside of acceptable values for the given parameter. -### VK_LAYER_LUNARG_ParamChecker Details Table +### VK_LAYER_LUNARG_param_checker Details Table | Check | Overview | ENUM | Relevant API | Testname | Notes/TODO | | ----- | -------- | ---------------- | ------------ | -------- | ---------- | @@ -136,7 +136,7 @@ The VK_LAYER_LUNARG_ParamChecker layer validates parameter values and flags erro | Call results, Output Parameters | Return values are checked for VK_SUCCESS, returned pointers are checked to be NON-NULL, enumerated types of return values are checked to be within the defined range. | NA | vkEnumeratePhysicalDevices vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceLimits vkGetPhysicalDeviceProperties vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceMemoryProperties vkGetDeviceQueue vkQueueSubmit vkQueueWaitIdle vkDeviceWaitIdle vkAllocateMemory vkFreeMemory vkMapMemory vkUnmapMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkGetDeviceMemoryCommitment vkBindBufferMemory vkBindImageMemory vkGetBufferMemoryRequirements vkGetImageMemoryRequirements vkGetImageSparseMemoryRequirements vkGetPhysicalDeviceSparseImageFormatProperties vkQueueBindSparse vkCreateFence vkDestroyFence vkResetFences vkGetFenceStatus vkWaitForFences vkCreateSemaphore vkDestroySemaphore vkCreateEvent vkDestroyEvent vkGetEventStatus vkSetEvent vkResetEvent vkCreateQueryPool vkDestroyQueryPool vkGetQueryPoolResults vkCreateBuffer vkDestroyBuffer vkCreateBufferView vkDestroyBufferView vkCreateImage vkDestroyImage vkGetImageSubresourceLayout vkCreateImageView vkDestroyImageView vkDestroyShaderModule vkCreatePipelineCache vkDestroyPipelineCache vkGetPipelineCacheData vkMergePipelineCaches vkCreateGraphicsPipelines vkCreateComputePipelines vkDestroyPipeline vkCreatePipelineLayout vkDestroyPipelineLayout vkCreateSampler vkDestroySampler vkCreateDescriptorSetLayout vkDestroyDescriptorSetLayout vkCreateDescriptorPool vkDestroyDescriptorPool vkResetDescriptorPool vkAllocateDescriptorSets vkFreeDescriptorSets vkUpdateDescriptorSets vkCreateFramebuffer vkDestroyFramebuffer vkCreateRenderPass vkDestroyRenderPass vkGetRenderAreaGranularity vkCreateCommandPool vkDestroyCommandPool vkResetCommandPool vkAllocateCommandBuffers vkFreeCommandBuffers vkBeginCommandBuffer vkEndCommandBuffer vkResetCommandBuffer vkCmdBindPipeline vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearAttachments vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdCopyQueryPoolResults vkCmdPushConstants vkCmdBeginRenderPass vkCmdNextSubpass vkCmdEndRenderPass vkCmdExecuteCommands | TBD | NA | | NA | Enum used for informational messages | NONE | | NA | None | -### VK_LAYER_LUNARG_ParamChecker Pending Work +### VK_LAYER_LUNARG_param_checker Pending Work Additional work to be done 1. Source2 was creating a VK_FORMAT_R8_SRGB texture (and image view) which was not supported by the underlying implementation (rendersystemtest imageformat test). Checking that formats are supported by the implementation is something the validation layer could do using the VK_FORMAT_INFO_TYPE_PROPERTIES query. There are probably a bunch of checks here you could be doing around vkCreateImage formats along with whether image/color/depth attachment views are valid. I’m not sure how much of this is already there. @@ -149,13 +149,13 @@ Additional work to be done 8. Check for valid VkIndexType in vkCmdBindIndexBuffer() should be in PreCmdBindIndexBuffer() call 9. Check for valid VkPipelineBindPoint in vkCmdBindPipeline() & vkCmdBindDescriptorSets() should be in PreCmdBindPipeline() & PreCmdBindDescriptorSets() calls respectively. -## VK_LAYER_LUNARG_Image +## VK_LAYER_LUNARG_image -### VK_LAYER_LUNARG_Image Layer Overview +### VK_LAYER_LUNARG_image Layer Overview -The VK_LAYER_LUNARG_Image layer is responsible for validating format-related information and enforcing format restrictions. +The VK_LAYER_LUNARG_image layer is responsible for validating format-related information and enforcing format restrictions. -### VK_LAYER_LUNARG_Image Layer Details Table +### VK_LAYER_LUNARG_image Layer Details Table DETAILS TABLE PENDING @@ -175,16 +175,16 @@ DETAILS TABLE PENDING | Verify Image Format Limits | Verifies that image creation parameters are with the device format limits | INVALID_FORMAT_LIMITS_VIOLATION | vkCreateImage | TBD | NA | | NA | Enum used for informational messages | NONE | | NA | None | -### VK_LAYER_LUNARG_Image Pending Work +### VK_LAYER_LUNARG_image Pending Work Additional work to be done -## VK_LAYER_LUNARG_MemTracker +## VK_LAYER_LUNARG_mem_tracker -### VK_LAYER_LUNARG_MemTracker Overview +### VK_LAYER_LUNARG_mem_tracker Overview -The VK_LAYER_LUNARG_MemTracker layer tracks memory objects and references and validates that they are managed correctly by the application. This includes tracking object bindings, memory hazards, and memory object lifetimes. VK_LAYER_LUNARG_MemTracker validates several other hazard-related issues related to command buffers, fences, and memory mapping. +The VK_LAYER_LUNARG_mem_tracker layer tracks memory objects and references and validates that they are managed correctly by the application. This includes tracking object bindings, memory hazards, and memory object lifetimes. VK_LAYER_LUNARG_mem_tracker validates several other hazard-related issues related to command buffers, fences, and memory mapping. -### VK_LAYER_LUNARG_MemTracker Details Table +### VK_LAYER_LUNARG_mem_tracker Details Table | Check | Overview | ENUM MEMTRACK_* | Relevant API | Testname | Notes/TODO | | ----- | -------- | ---------------- | ------------ | -------- | ---------- | @@ -193,7 +193,7 @@ The VK_LAYER_LUNARG_MemTracker layer tracks memory objects and references and va | Free Referenced Memory | Checks to see if memory being freed still has current references | FREED_MEM_REF | vmFreeMemory | FreeBoundMemory | NA | | Memory Properly Bound | Validate that the memory object referenced in the call was properly created, is currently valid, and is properly bound to the object | MISSING_MEM_BINDINGS | vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyQueryPoolResults vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | NA | | Valid Object | Verifies that the specified Vulkan object was created properly and is currently valid | INVALID_OBJECT | vkCmdBindPipeline vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | NA | -| Bind Invalid Memory | Validate that memory object was correctly created, that the command buffer object was correctly created, and that both are currently valid objects. | MEMORY_BINDING_ERROR | vkQueueBindSparse vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | The valid Object checks are primarily the responsibilty of VK_LAYER_LUNARG_ObjectTracker layer, so these checks are more of a backup in case VK_LAYER_LUNARG_ObjectTracker is not enabled | +| Bind Invalid Memory | Validate that memory object was correctly created, that the command buffer object was correctly created, and that both are currently valid objects. | MEMORY_BINDING_ERROR | vkQueueBindSparse vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | The valid Object checks are primarily the responsibilty of VK_LAYER_LUNARG_object_tracker layer, so these checks are more of a backup in case VK_LAYER_LUNARG_object_tracker is not enabled | | Objects Not Destroyed | Verify all objects destroyed at DestroyDevice time | MEMORY_LEAK | vkDestroyDevice | NA | NA | | Memory Mapping State | Verifies that mapped memory is CPU-visible | INVALID_STATE | vkMapMemory | MapMemWithoutHostVisibleBit | NA | | Command Buffer Synchronization | Command Buffer must be complete before BeginCommandBuffer or ResetCommandBuffer can be called | RESET_CB_WHILE_IN_FLIGHT | vkBeginCommandBuffer vkResetCommandBuffer | CallBeginCommandBufferBeforeCompletion CallBeginCommandBufferBeforeCompletion | NA | @@ -205,9 +205,9 @@ The VK_LAYER_LUNARG_MemTracker layer tracks memory objects and references and va | NA | Enum used for informational messages | NONE | | NA | None | | NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | NA | None | -### VK_LAYER_LUNARG_MemTracker Pending Work +### VK_LAYER_LUNARG_mem_tracker Pending Work -#### VK_LAYER_LUNARG_MemTracker Enhancements +#### VK_LAYER_LUNARG_mem_tracker Enhancements 1. Flag any memory hazards: Validate that the pipeline barriers for buffers are sufficient to avoid hazards 2. Make sure that the XGL_IMAGE_VIEW_ATTACH_INFO.layout matches the layout of the image as determined by the last IMAGE_MEMORY_BARRIER @@ -221,13 +221,13 @@ The VK_LAYER_LUNARG_MemTracker layer tracks memory objects and references and va 12. Modify INVALID_FENCE_STATE to be WARNINGs instead of ERROR 13. Report destroy or modify of resources in use on queues and not cleared by fence or WaitIdle. Could be fence, semaphore, or objects used by submitted CommandBuffers. -## VK_LAYER_LUNARG_ObjectTracker +## VK_LAYER_LUNARG_object_tracker -### VK_LAYER_LUNARG_ObjectTracker Overview +### VK_LAYER_LUNARG_object_tracker Overview -The VK_LAYER_LUNARG_ObjectTracker layer maintains a record of all Vulkan objects. It flags errors when invalid objects are used and at DestroyInstance time it flags any objects that were not properly destroyed. +The VK_LAYER_LUNARG_object_tracker layer maintains a record of all Vulkan objects. It flags errors when invalid objects are used and at DestroyInstance time it flags any objects that were not properly destroyed. -### VK_LAYER_LUNARG_ObjectTracker Details Table +### VK_LAYER_LUNARG_object_tracker Details Table | Check | Overview | ENUM OBJTRACK_* | Relevant API | Testname | Notes/TODO | | ----- | -------- | ---------------- | ------------ | -------- | ---------- | @@ -242,7 +242,7 @@ The VK_LAYER_LUNARG_ObjectTracker layer maintains a record of all Vulkan objects | NA | Enum used for informational messages | NONE | | NA | None | | NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | NA | None | -### VK_LAYER_LUNARG_ObjectTracker Pending Work +### VK_LAYER_LUNARG_object_tracker Pending Work 4. Verify images have CmdPipelineBarrier layouts matching new layout parameters to Cmd*Image* functions 6. For specific object instances that are allowed to be NULL, update object validation to verify that such objects are either NULL or valid @@ -251,11 +251,11 @@ The VK_LAYER_LUNARG_ObjectTracker layer maintains a record of all Vulkan objects 9. Use reference counting for non-dispatchable objects. Multiple object creation calls may return identical handles. 10. Update codegen for destroy_obj & validate_obj to generate all of the correct signatures and use the generated code -## VK_LAYER_LUNARG_Threading +## VK_LAYER_LUNARG_threading -### VK_LAYER_LUNARG_Threading Overview +### VK_LAYER_LUNARG_threading Overview -The VK_LAYER_LUNARG_Threading layer checks for simultaneous use of objects by calls from multiple threads. +The VK_LAYER_LUNARG_threading layer checks for simultaneous use of objects by calls from multiple threads. Application code is responsible for preventing simultaneous use of the same objects by certain calls that modify objects. See [bug 13433](https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13433) and @@ -276,7 +276,7 @@ But the layer cannot prevent such a reentrant use of an object. The layer can only observe when a mutual exclusion rule is actually violated. It cannot insure that there is no latent race condition. -### VK_LAYER_LUNARG_Threading Details Table +### VK_LAYER_LUNARG_threading Details Table | Check | Overview | ENUM THREADING_CHECKER_* | Relevant API | Testname | Notes/TODO | | ----- | -------- | ---------------- | ---------------- | -------- | ---------- | @@ -284,26 +284,26 @@ It cannot insure that there is no latent race condition. | Thread Reentrancy | Detects cases of a single thread calling Vulkan reentrantly | SINGLE_THREAD_REUSE | vkQueueSubmit vkFreeMemory vkMapMemory vkUnmapMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkBindBufferMemory vkBindImageMemory vkQueueBindSparse vkDestroySemaphore vkDestroyBuffer vkDestroyImage vkDestroyDescriptorPool vkResetDescriptorPool vkAllocateDescriptorSets vkFreeDescriptorSets vkFreeCommandBuffers vkBeginCommandBuffer vkEndCommandBuffer vkResetCommandBuffer vkCmdBindPipeline vkCmdSetViewport vkCmdSetBlendConstants vkCmdSetLineWidth vkCmdSetDepthBias vkCmdSetDepthBounds vkCmdSetStencilCompareMask vkCmdSetStencilWriteMask vkCmdSetStencilReference vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearAttachments vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdCopyQueryPoolResults vkCmdBeginRenderPass vkCmdNextSubpass vkCmdPushConstants vkCmdEndRenderPass vkCmdExecuteCommands | ??? | NA | | NA | Enum used for informational messages | NONE | | NA | None | -### VK_LAYER_LUNARG_Threading Pending Work +### VK_LAYER_LUNARG_threading Pending Work Additional work to be done -## VK_LAYER_LUNARG_DeviceLimits +## VK_LAYER_LUNARG_device_limits -### VK_LAYER_LUNARG_DeviceLimits Overview +### VK_LAYER_LUNARG_device_limits Overview -This layer is a work in progress. VK_LAYER_LUNARG_DeviceLimits layer is intended to capture two broad categories of errors: +This layer is a work in progress. VK_LAYER_LUNARG_device_limits layer is intended to capture two broad categories of errors: 1. Incorrect use of APIs to query device capabilities 2. Attempt to use API functionality beyond the capability of the underlying device For the first category, the layer tracks which calls are made and flags errors if calls are excluded that should not be, or if call sequencing is incorrect. An example is an app that assumes attempts to Query and use queues without ever having called vkGetPhysicalDeviceQueueFamilyProperties(). Also, if an app is calling vkGetPhysicalDeviceQueueFamilyProperties() to retrieve properties with some assumed count for array size instead of first calling vkGetPhysicalDeviceQueueFamilyProperties() w/ a NULL pQueueFamilyProperties parameter in order to query the actual count. -For the second category of errors, VK_LAYER_LUNARG_DeviceLimits stores its own internal record of underlying device capabilities and flags errors if requests are made beyond those limits. Most (all?) of the limits are queried via vkGetPhysicalDevice* calls. +For the second category of errors, VK_LAYER_LUNARG_device_limits stores its own internal record of underlying device capabilities and flags errors if requests are made beyond those limits. Most (all?) of the limits are queried via vkGetPhysicalDevice* calls. -### VK_LAYER_LUNARG_DeviceLimits Details Table +### VK_LAYER_LUNARG_device_limits Details Table | Check | Overview | ENUM DEVLIMITS_* | Relevant API | Testname | Notes/TODO | | ----- | -------- | ---------------- | ---------------- | -------- | ---------- | -| Valid instance | If an invalid instance is used, this error will be flagged | INVALID_INSTANCE | vkEnumeratePhysicalDevices | NA | VK_LAYER_LUNARG_ObjectTracker should also catch this so if we made sure VK_LAYER_LUNARG_ObjectTracker was always on top, we could avoid this check | -| Valid physical device | Enum used for informational messages | INVALID_PHYSICAL_DEVICE | vkEnumeratePhysicalDevices | NA | VK_LAYER_LUNARG_ObjectTracker should also catch this so if we made sure VK_LAYER_LUNARG_ObjectTracker was always on top, we could avoid this check | +| Valid instance | If an invalid instance is used, this error will be flagged | INVALID_INSTANCE | vkEnumeratePhysicalDevices | NA | VK_LAYER_LUNARG_object_tracker should also catch this so if we made sure VK_LAYER_LUNARG_object_tracker was always on top, we could avoid this check | +| Valid physical device | Enum used for informational messages | INVALID_PHYSICAL_DEVICE | vkEnumeratePhysicalDevices | NA | VK_LAYER_LUNARG_object_tracker should also catch this so if we made sure VK_LAYER_LUNARG_object_tracker was always on top, we could avoid this check | | Querying array counts | For API calls where an array count should be queried with an initial call and a NULL array pointer, verify that such a call was made before making a call with non-null array pointer. | MUST_QUERY_COUNT | vkEnumeratePhysicalDevices vkGetPhysicalDeviceQueueFamilyProperties | NA | Create focused test | | Array count value | For API calls where an array of details is queried, verify that the size of the requested array matches the size of the array supported by the device. | COUNT_MISMATCH | vkEnumeratePhysicalDevices vkGetPhysicalDeviceQueueFamilyProperties | NA | Create focused test | | Queue Creation | When creating/requesting queues, make sure that QueueFamilyPropertiesIndex and index/count within that queue family are valid. | INVALID_QUEUE_CREATE_REQUEST | vkGetDeviceQueue vkCreateDevice | NA | Create focused test | @@ -316,17 +316,17 @@ For the second category of errors, VK_LAYER_LUNARG_DeviceLimits stores its own i | Alignment | When filling a buffer, data should be aligned on 4 byte boundaries | LIMITS_VIOLATION | vkCmdFillBuffer | UpdateBufferAlignment | NA | | NA | Enum used for informational messages | NONE | | NA | None | -### VK_LAYER_LUNARG_DeviceLimits Pending Work +### VK_LAYER_LUNARG_device_limits Pending Work 1. For all Formats, call vkGetPhysicalDeviceFormatProperties to pull their properties for the underlying device. After that point, if the app attempts to use any formats in violation of those properties, flag errors (this is done for Images). -## VK_LAYER_LUNARG_Swapchain +## VK_LAYER_LUNARG_swapchain ### Swapchain Overview -This layer is a work in progress. VK_LAYER_LUNARG_Swapchain layer is intended to ... +This layer is a work in progress. VK_LAYER_LUNARG_swapchain layer is intended to ... -### VK_LAYER_LUNARG_Swapchain Details Table +### VK_LAYER_LUNARG_swapchain Details Table | Check | Overview | ENUM SWAPCHAIN_* | Relevant API | Testname | Notes/TODO | | ----- | -------- | ---------------- | ------------ | -------- | ---------- | @@ -349,8 +349,8 @@ This layer is a work in progress. VK_LAYER_LUNARG_Swapchain layer is intended to | Index too large | Validates that an image index is within the number of images in a swapchain | INDEX_TOO_LARGE | vkQueuePresentKHR | NA | None | | Can't present a non-owned image | Validates that application only presents images that it owns | INDEX_NOT_IN_USE | vkQueuePresentKHR | NA | None | -### VK_LAYER_LUNARG_Swapchain Pending Work -Additional checks to be added to VK_LAYER_LUNARG_Swapchain +### VK_LAYER_LUNARG_swapchain Pending Work +Additional checks to be added to VK_LAYER_LUNARG_swapchain 1. Check that the queue used for presenting was checked/valid during vkGetPhysicalDeviceSurfaceSupportKHR. 2. One issue that has already come up is correct UsageFlags for WSI SwapChains and SurfaceProperties. @@ -358,11 +358,11 @@ Additional checks to be added to VK_LAYER_LUNARG_Swapchain # Non-validation Layer Details -## VK_LAYER_LUNARG_APIDump +## VK_LAYER_LUNARG_api_dump -VK_LAYER_LUNARG_APIDump layer is used for dumping a stream of all the Vulkan API calls that are made, along with details of the parameters to those calls. +VK_LAYER_LUNARG_api_dump layer is used for dumping a stream of all the Vulkan API calls that are made, along with details of the parameters to those calls. -### VK_LAYER_LUNARG_APIDump Pending Work +### VK_LAYER_LUNARG_api_dump Pending Work 1. vkAllocateDescriptorSets does not correctly print out all of the created DescriptorSets (no array printing following main API txt) diff --git a/layers/linux/api_dump.json b/layers/windows/VkLayer_api_dump.json similarity index 68% rename from layers/linux/api_dump.json rename to layers/windows/VkLayer_api_dump.json index a2de51a5..2b9c438c 100644 --- a/layers/linux/api_dump.json +++ b/layers/windows/VkLayer_api_dump.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_APIDump", + "name": "VK_LAYER_LUNARG_api_dump", "type": "GLOBAL", - "library_path": "./libVKLayerAPIDump.so", + "library_path": ".\\VkLayer_api_dump.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG debug layer" diff --git a/layers/windows/basic.json b/layers/windows/VkLayer_basic.json similarity index 82% rename from layers/windows/basic.json rename to layers/windows/VkLayer_basic.json index d16beb6d..bef89944 100644 --- a/layers/windows/basic.json +++ b/layers/windows/VkLayer_basic.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Basic", + "name": "VK_LAYER_LUNARG_basic", "type": "GLOBAL", - "library_path": ".\\VKLayerBasic.dll", + "library_path": ".\\VkLayer_basic.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Sample Layer", diff --git a/layers/linux/device_limits.json b/layers/windows/VkLayer_device_limits.json similarity index 77% rename from layers/linux/device_limits.json rename to layers/windows/VkLayer_device_limits.json index bf7aa1bc..c3555ab1 100644 --- a/layers/linux/device_limits.json +++ b/layers/windows/VkLayer_device_limits.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_DeviceLimits", + "name": "VK_LAYER_LUNARG_device_limits", "type": "GLOBAL", - "library_path": "./libVKLayerDeviceLimits.so", + "library_path": ".\\VkLayer_device_limits.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/windows/draw_state.json b/layers/windows/VkLayer_draw_state.json similarity index 85% rename from layers/windows/draw_state.json rename to layers/windows/VkLayer_draw_state.json index 2e557f11..1ee4c339 100644 --- a/layers/windows/draw_state.json +++ b/layers/windows/VkLayer_draw_state.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_DrawState", + "name": "VK_LAYER_LUNARG_draw_state", "type": "GLOBAL", - "library_path": ".\\VKLayerDrawState.dll", + "library_path": ".\\VkLayer_draw_state.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/linux/generic.json b/layers/windows/VkLayer_generic.json similarity index 54% rename from layers/linux/generic.json rename to layers/windows/VkLayer_generic.json index 44ec1245..f8c19353 100644 --- a/layers/linux/generic.json +++ b/layers/windows/VkLayer_generic.json @@ -1,11 +1,11 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Generic", + "name": "VK_LAYER_LUNARG_generic", "type": "GLOBAL", - "library_path": "./libVKLayerGeneric.so", + "library_path": ".\\VkLayer_generic.dll", "api_version": "0.210.0", "implementation_version": "1", - "description": "LunarG Sample Layer" + "description": "LunarG sample layer" } } diff --git a/layers/linux/image.json b/layers/windows/VkLayer_image.json similarity index 80% rename from layers/linux/image.json rename to layers/windows/VkLayer_image.json index b1fb9eb7..266a6260 100644 --- a/layers/linux/image.json +++ b/layers/windows/VkLayer_image.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Image", + "name": "VK_LAYER_LUNARG_image", "type": "GLOBAL", - "library_path": "./libVKLayerImage.so", + "library_path": ".\\VkLayer_image.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/linux/mem_tracker.json b/layers/windows/VkLayer_mem_tracker.json similarity index 78% rename from layers/linux/mem_tracker.json rename to layers/windows/VkLayer_mem_tracker.json index 8ecf849b..f451f2b6 100644 --- a/layers/linux/mem_tracker.json +++ b/layers/windows/VkLayer_mem_tracker.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_MemTracker", + "name": "VK_LAYER_LUNARG_mem_tracker", "type": "GLOBAL", - "library_path": "./libVKLayerMemTracker.so", + "library_path": ".\\VkLayer_mem_tracker.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/windows/multi.json b/layers/windows/VkLayer_multi.json similarity index 87% rename from layers/windows/multi.json rename to layers/windows/VkLayer_multi.json index 856d4b76..4892e9a2 100644 --- a/layers/windows/multi.json +++ b/layers/windows/VkLayer_multi.json @@ -3,7 +3,7 @@ "layer" : { "name": "VK_LAYER_LUNARG_multi1", "type": "DEVICE", - "library_path": ".\\VKLayerMulti.dll", + "library_path": ".\\VkLayer_multi.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Sample multiple layer per library", @@ -14,7 +14,7 @@ "layer" : { "name": "VK_LAYER_LUNARG_multi2", "type": "INSTANCE", - "library_path": ".\\VKLayerMulti.dll", + "library_path": ".\\VkLayer_multi.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Sample multiple layer per library", diff --git a/layers/windows/VkLayer_object_tracker.json b/layers/windows/VkLayer_object_tracker.json new file mode 100644 index 00000000..b4862b9c --- /dev/null +++ b/layers/windows/VkLayer_object_tracker.json @@ -0,0 +1,17 @@ +{ + "file_format_version" : "1.0.0", + "layer" : { + "name": "VK_LAYER_LUNARG_object_tracker", + "type": "GLOBAL", + "library_path": ".\\VkLayer_object_tracker.dll", + "api_version": "0.210.0", + "implementation_version": "1", + "description": "LunarG Validation Layer", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "2" + } + ] + } +} diff --git a/layers/linux/object_tracker.json b/layers/windows/VkLayer_param_checker.json similarity index 77% rename from layers/linux/object_tracker.json rename to layers/windows/VkLayer_param_checker.json index 7b21a910..8767babc 100644 --- a/layers/linux/object_tracker.json +++ b/layers/windows/VkLayer_param_checker.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_ObjectTracker", + "name": "VK_LAYER_LUNARG_param_checker", "type": "GLOBAL", - "library_path": "./libVKLayerObjectTracker.so", + "library_path": ".\\VkLayer_param_checker.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/linux/screenshot.json b/layers/windows/VkLayer_screenshot.json similarity index 68% rename from layers/linux/screenshot.json rename to layers/windows/VkLayer_screenshot.json index 4b622daf..13ae7f83 100644 --- a/layers/linux/screenshot.json +++ b/layers/windows/VkLayer_screenshot.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_ScreenShot", + "name": "VK_LAYER_LUNARG_screenshot", "type": "GLOBAL", - "library_path": "./libVKLayerScreenShot.so", + "library_path": ".\\VkLayer_screenshot.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG image capture layer" diff --git a/layers/linux/swapchain.json b/layers/windows/VkLayer_swapchain.json similarity index 79% rename from layers/linux/swapchain.json rename to layers/windows/VkLayer_swapchain.json index dc2ce5b6..a27dd87f 100644 --- a/layers/linux/swapchain.json +++ b/layers/windows/VkLayer_swapchain.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Swapchain", + "name": "VK_LAYER_LUNARG_swapchain", "type": "GLOBAL", - "library_path": "./libVKLayerSwapchain.so", + "library_path": ".\\VkLayer_swapchain.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/linux/threading.json b/layers/windows/VkLayer_threading.json similarity index 79% rename from layers/linux/threading.json rename to layers/windows/VkLayer_threading.json index 3e64325e..54a9b889 100644 --- a/layers/linux/threading.json +++ b/layers/windows/VkLayer_threading.json @@ -1,9 +1,9 @@ { "file_format_version" : "1.0.0", "layer" : { - "name": "VK_LAYER_LUNARG_Threading", + "name": "VK_LAYER_LUNARG_threading", "type": "GLOBAL", - "library_path": "./libVKLayerThreading.so", + "library_path": ".\\VkLayer_threading.dll", "api_version": "0.210.0", "implementation_version": "1", "description": "LunarG Validation Layer", diff --git a/layers/windows/device_limits.json b/layers/windows/device_limits.json deleted file mode 100644 index 6b6659fe..00000000 --- a/layers/windows/device_limits.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "file_format_version" : "1.0.0", - "layer" : { - "name": "VK_LAYER_LUNARG_DeviceLimits", - "type": "GLOBAL", - "library_path": ".\\VKLayerDeviceLimits.dll", - "api_version": "0.210.0", - "implementation_version": "1", - "description": "LunarG Validation Layer", - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "2" - } - ] - } -} diff --git a/layers/windows/mem_tracker.json b/layers/windows/mem_tracker.json deleted file mode 100644 index 38ef5283..00000000 --- a/layers/windows/mem_tracker.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "file_format_version" : "1.0.0", - "layer" : { - "name": "VK_LAYER_LUNARG_MemTracker", - "type": "GLOBAL", - "library_path": ".\\VKLayerMemTracker.dll", - "api_version": "0.210.0", - "implementation_version": "1", - "description": "LunarG Validation Layer", - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "2" - } - ] - } -} diff --git a/layers/windows/object_tracker.json b/layers/windows/object_tracker.json deleted file mode 100644 index 67622248..00000000 --- a/layers/windows/object_tracker.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "file_format_version" : "1.0.0", - "layer" : { - "name": "VK_LAYER_LUNARG_ObjectTracker", - "type": "GLOBAL", - "library_path": ".\\VKLayerObjectTracker.dll", - "api_version": "0.210.0", - "implementation_version": "1", - "description": "LunarG Validation Layer", - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "2" - } - ] - } -} diff --git a/layers/windows/param_checker.json b/layers/windows/param_checker.json deleted file mode 100644 index 5909b0d8..00000000 --- a/layers/windows/param_checker.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "file_format_version" : "1.0.0", - "layer" : { - "name": "VK_LAYER_LUNARG_ParamChecker", - "type": "GLOBAL", - "library_path": ".\\VKLayerParamChecker.dll", - "api_version": "0.210.0", - "implementation_version": "1", - "description": "LunarG Validation Layer", - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "2" - } - ] - } -} diff --git a/layers/windows/swapchain.json b/layers/windows/swapchain.json deleted file mode 100644 index 99ed2bc4..00000000 --- a/layers/windows/swapchain.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "file_format_version" : "1.0.0", - "layer" : { - "name": "VK_LAYER_LUNARG_Swapchain", - "type": "GLOBAL", - "library_path": ".\\VKLayerSwapchain.dll", - "api_version": "0.210.0", - "implementation_version": "1", - "description": "LunarG Validation Layer", - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "2" - } - ] - } -} diff --git a/layers/windows/threading.json b/layers/windows/threading.json deleted file mode 100644 index 73d99062..00000000 --- a/layers/windows/threading.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "file_format_version" : "1.0.0", - "layer" : { - "name": "VK_LAYER_LUNARG_Threading", - "type": "GLOBAL", - "library_path": ".\\VKLayerThreading.dll", - "api_version": "0.210.0", - "implementation_version": "1", - "description": "LunarG Validation Layer", - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "2" - } - ] - } -} diff --git a/vk-generate.py b/vk-generate.py index 36a830d7..0a986029 100755 --- a/vk-generate.py +++ b/vk-generate.py @@ -259,7 +259,7 @@ class WinDefFileSubcommand(Subcommand): "vkEnumerateInstanceLayerProperties", "vkEnumerateInstanceExtensionProperties" ], - "layerMulti": [ + "layer_multi": [ "multi2GetInstanceProcAddr", "multi1GetDeviceProcAddr" ] @@ -271,8 +271,8 @@ class WinDefFileSubcommand(Subcommand): return self.library = self.argv[0] - if self.library == "VKLayerMulti": - self.exports = library_exports["layerMulti"] + if self.library == "VkLayer_multi": + self.exports = library_exports["layer_multi"] else: self.exports = library_exports[self.argv[1]] @@ -317,7 +317,7 @@ class WinDefFileSubcommand(Subcommand): body.append("EXPORTS") for proto in self.exports: - if self.library != "VKLayerSwapchain" or proto != "vkEnumerateInstanceExtensionProperties" and proto != "vkEnumerateInstanceLayerProperties": + if self.library != "VkLayerSwapchain" or proto != "vkEnumerateInstanceExtensionProperties" and proto != "vkEnumerateInstanceLayerProperties": body.append( proto) return "\n".join(body) diff --git a/vk-layer-generate.py b/vk-layer-generate.py index 0be89247..fc498851 100755 --- a/vk-layer-generate.py +++ b/vk-layer-generate.py @@ -234,7 +234,7 @@ class Subcommand(object): r_body.append(' VkDebugReportCallbackEXT* pCallback)') r_body.append('{') # Switch to this code section for the new per-instance storage and debug callbacks - if self.layer_name == 'ObjectTracker' or self.layer_name == 'Threading': + if self.layer_name == 'object_tracker' or self.layer_name == 'threading': r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(%s_instance_table_map, instance);' % self.layer_name ) r_body.append(' VkResult result = pInstanceTable->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback);') r_body.append(' if (VK_SUCCESS == result) {') @@ -261,7 +261,7 @@ class Subcommand(object): r_body.append('VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT msgCallback, const VkAllocationCallbacks *pAllocator)') r_body.append('{') # Switch to this code section for the new per-instance storage and debug callbacks - if self.layer_name == 'ObjectTracker' or self.layer_name == 'Threading': + if self.layer_name == 'object_tracker' or self.layer_name == 'threading': r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(%s_instance_table_map, instance);' % self.layer_name ) else: r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = instance_dispatch_table(instance);') @@ -277,7 +277,7 @@ class Subcommand(object): r_body.append('VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg)') r_body.append('{') # Switch to this code section for the new per-instance storage and debug callbacks - if self.layer_name == 'ObjectTracker' or self.layer_name == 'Threading': + if self.layer_name == 'object_tracker' or self.layer_name == 'threading': r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(%s_instance_table_map, instance);' % self.layer_name ) else: r_body.append(' VkLayerInstanceDispatchTable *pInstanceTable = instance_dispatch_table(instance);') @@ -285,13 +285,13 @@ class Subcommand(object): r_body.append('}') return "\n".join(r_body) - def _gen_layer_get_global_extension_props(self, layer="Generic"): + def _gen_layer_get_global_extension_props(self, layer="generic"): ggep_body = [] # generated layers do not provide any global extensions ggep_body.append('%s' % self.lineinfo.get()) ggep_body.append('') - if self.layer_name == 'ObjectTracker' or self.layer_name == 'Threading': + if self.layer_name == 'object_tracker' or self.layer_name == 'threading': ggep_body.append('static const VkExtensionProperties instance_extensions[] = {') ggep_body.append(' {') ggep_body.append(' VK_EXT_DEBUG_REPORT_EXTENSION_NAME,') @@ -300,16 +300,16 @@ class Subcommand(object): ggep_body.append('};') ggep_body.append('VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, VkExtensionProperties* pProperties)') ggep_body.append('{') - if self.layer_name == 'ObjectTracker' or self.layer_name == 'Threading': + if self.layer_name == 'object_tracker' or self.layer_name == 'threading': ggep_body.append(' return util_GetExtensionProperties(1, instance_extensions, pCount, pProperties);') else: ggep_body.append(' return util_GetExtensionProperties(0, NULL, pCount, pProperties);') ggep_body.append('}') return "\n".join(ggep_body) - def _gen_layer_get_global_layer_props(self, layer="Generic"): + def _gen_layer_get_global_layer_props(self, layer="generic"): ggep_body = [] - if layer == 'Generic': + if layer == 'generic': # Do nothing, extension definition part of generic.h ggep_body.append('%s' % self.lineinfo.get()) else: @@ -333,9 +333,9 @@ class Subcommand(object): ggep_body.append('}') return "\n".join(ggep_body) - def _gen_layer_get_physical_device_layer_props(self, layer="Generic"): + def _gen_layer_get_physical_device_layer_props(self, layer="generic"): gpdlp_body = [] - if layer == 'Generic': + if layer == 'generic': # Do nothing, extension definition part of generic.h gpdlp_body.append('%s' % self.lineinfo.get()) else: @@ -446,7 +446,7 @@ class Subcommand(object): # # New style of GPA Functions for the new layer_data/layer_logging changes # - if self.layer_name == 'ObjectTracker' or self.layer_name == 'Threading': + if self.layer_name == 'object_tracker' or self.layer_name == 'threading': func_body.append("VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char* funcName)\n" "{\n" " PFN_vkVoidFunction addr;\n" @@ -536,7 +536,7 @@ class Subcommand(object): " if (device == VK_NULL_HANDLE) {\n" " return NULL;\n" " }\n") - if self.layer_name == 'Generic': + if self.layer_name == 'generic': func_body.append("\n" " /* loader uses this to force layer initialization; device object is wrapped */\n" " if (!strcmp(\"vkGetDeviceProcAddr\", funcName)) {\n" @@ -585,7 +585,7 @@ class Subcommand(object): " if (instance == VK_NULL_HANDLE) {\n" " return NULL;\n" " }\n") - if self.layer_name == 'Generic': + if self.layer_name == 'generic': func_body.append("\n" " /* loader uses this to force layer initialization; instance object is wrapped */\n" " if (!strcmp(\"vkGetInstanceProcAddr\", funcName)) {\n" @@ -642,7 +642,7 @@ class Subcommand(object): def _generate_layer_initialization(self, init_opts=False, prefix='vk', lockname=None, condname=None): func_body = ["#include \"vk_dispatch_table_helper.h\""] func_body.append('%s' % self.lineinfo.get()) - func_body.append('static void init%s(layer_data *my_data, const VkAllocationCallbacks *pAllocator)\n' + func_body.append('static void init_%s(layer_data *my_data, const VkAllocationCallbacks *pAllocator)\n' '{\n' % self.layer_name) if init_opts: func_body.append('%s' % self.lineinfo.get()) @@ -685,7 +685,7 @@ class Subcommand(object): def _generate_new_layer_initialization(self, init_opts=False, prefix='vk', lockname=None, condname=None): func_body = ["#include \"vk_dispatch_table_helper.h\""] func_body.append('%s' % self.lineinfo.get()) - func_body.append('static void init%s(layer_data *my_data, const VkAllocationCallbacks *pAllocator)\n' + func_body.append('static void init_%s(layer_data *my_data, const VkAllocationCallbacks *pAllocator)\n' '{\n' % self.layer_name) if init_opts: func_body.append('%s' % self.lineinfo.get()) @@ -783,14 +783,14 @@ class GenericLayerSubcommand(Subcommand): ' layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map);\n' ' sprintf(str, "At start of Generic layered %s\\n");\n' ' log_msg(my_data->report_data, VK_DEBUG_REPORT_INFO_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,' - ' (uint64_t)physicalDevice, 0, 0, (char *) "Generic", "%%s", (char *) str);\n' + ' (uint64_t)physicalDevice, 0, 0, (char *) "generic", "%%s", (char *) str);\n' ' %sdevice_dispatch_table(*pDevice)->%s;\n' ' if (result == VK_SUCCESS) {\n' ' my_data->report_data = layer_debug_report_create_device(my_data->report_data, *pDevice);\n' ' createDeviceRegisterExtensions(pCreateInfo, *pDevice);\n' ' }\n' - ' sprintf(str, "Completed Generic layered %s\\n");\n' - ' log_msg(my_data->report_data, VK_DEBUG_REPORT_INFO_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, (uint64_t)physicalDevice, 0, 0, (char *) "Generic", "%%s", (char *) str);\n' + ' sprintf(str, "Completed generic layered %s\\n");\n' + ' log_msg(my_data->report_data, VK_DEBUG_REPORT_INFO_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, (uint64_t)physicalDevice, 0, 0, (char *) "generic", "%%s", (char *) str);\n' ' %s' '}' % (qual, decl, proto.name, ret_val, proto.c_call(), proto.name, stmt)) elif proto.name == "DestroyDevice": @@ -835,9 +835,9 @@ class GenericLayerSubcommand(Subcommand): ' *pInstance,\n' ' pCreateInfo->enabledExtensionNameCount,\n' ' pCreateInfo->ppEnabledExtensionNames);\n' - ' initGeneric(my_data, pAllocator);\n' - ' sprintf(str, "Completed Generic layered %s\\n");\n' - ' log_msg(my_data->report_data, VK_DEBUG_REPORT_INFO_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, (uint64_t)*pInstance, 0, 0, (char *) "Generic", "%%s", (char *) str);\n' + ' init_generic(my_data, pAllocator);\n' + ' sprintf(str, "Completed generic layered %s\\n");\n' + ' log_msg(my_data->report_data, VK_DEBUG_REPORT_INFO_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, (uint64_t)*pInstance, 0, 0, (char *) "generic", "%%s", (char *) str);\n' ' }\n' ' return result;\n' '}\n' % (qual, decl, ret_val, proto.c_call(), proto.name)) @@ -862,7 +862,7 @@ class GenericLayerSubcommand(Subcommand): return "\n\n".join(funcs) def generate_body(self): - self.layer_name = "Generic" + self.layer_name = "generic" instance_extensions=[('msg_callback_get_proc_addr', []), ('wsi_enabled', ['vkGetPhysicalDeviceSurfaceSupportKHR', @@ -897,7 +897,7 @@ class APIDumpSubcommand(Subcommand): header_txt.append('#include "vk_layer_table.h"') header_txt.append('#include "vk_layer_extension_utils.h"') header_txt.append('#include ') - header_txt.append('#include "apidump.h"') + header_txt.append('#include "api_dump.h"') header_txt.append('') header_txt.append('static std::ofstream fileStream;') header_txt.append('static std::string fileName = "vk_apidump.txt";') @@ -909,12 +909,12 @@ class APIDumpSubcommand(Subcommand): header_txt.append(' if (fileName == "stdout")') header_txt.append(' {') header_txt.append(' outputStream = &std::cout;') - header_txt.append(' (*outputStream) << endl << "APIDump output filename \'stdout\' specified. Writing to STDOUT instead of a file." << endl << endl;') + header_txt.append(' (*outputStream) << endl << "api_dump output filename \'stdout\' specified. Writing to STDOUT instead of a file." << endl << endl;') header_txt.append(' } else {') header_txt.append(' fileStream.open(fileName);') header_txt.append(' if ((fileStream.rdstate() & fileStream.failbit) != 0) {') header_txt.append(' outputStream = &std::cout;') - header_txt.append(' (*outputStream) << endl << "APIDump ERROR: Bad output filename specified: " << fileName << ". Writing to STDOUT instead" << endl << endl;') + header_txt.append(' (*outputStream) << endl << "api_dump ERROR: Bad output filename specified: " << fileName << ". Writing to STDOUT instead" << endl << endl;') header_txt.append(' }') header_txt.append(' else') header_txt.append(' outputStream = &fileStream;') @@ -1281,7 +1281,7 @@ class APIDumpSubcommand(Subcommand): return "\n\n".join(funcs) def generate_body(self): - self.layer_name = "APIDump" + self.layer_name = "api_dump" if sys.platform.startswith('win32'): instance_extensions=[('wsi_enabled', ['vkGetPhysicalDeviceSurfaceSupportKHR', @@ -1335,8 +1335,8 @@ class ObjectTrackerSubcommand(Subcommand): header_txt.append('#include "vk_layer_data.h"') header_txt.append('#include "vk_layer_logging.h"') header_txt.append('') -# NOTE: The non-autoGenerated code is in the object_track.h header file - header_txt.append('#include "object_track.h"') +# NOTE: The non-autoGenerated code is in the object_tracker.h header file + header_txt.append('#include "object_tracker.h"') header_txt.append('') header_txt.append('static LOADER_PLATFORM_THREAD_ONCE_DECLARATION(initOnce);') header_txt.append('') @@ -1532,7 +1532,7 @@ class ObjectTrackerSubcommand(Subcommand): gedi_txt.append(' %sMap.clear();' % (o)) gedi_txt.append('') gedi_txt.append(' dispatch_key key = get_dispatch_key(instance);') - gedi_txt.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(ObjectTracker_instance_table_map, instance);') + gedi_txt.append(' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(object_tracker_instance_table_map, instance);') gedi_txt.append(' pInstanceTable->DestroyInstance(instance, pAllocator);') gedi_txt.append('') gedi_txt.append(' // Clean up logging callback, if any') @@ -1547,8 +1547,8 @@ class ObjectTrackerSubcommand(Subcommand): gedi_txt.append(' instanceExtMap.erase(pInstanceTable);') gedi_txt.append(' loader_platform_thread_unlock_mutex(&objLock);') # The loader holds a mutex that protects this from other threads - gedi_txt.append(' ObjectTracker_instance_table_map.erase(key);') - gedi_txt.append(' if (ObjectTracker_instance_table_map.empty()) {') + gedi_txt.append(' object_tracker_instance_table_map.erase(key);') + gedi_txt.append(' if (object_tracker_instance_table_map.empty()) {') gedi_txt.append(' // Release mutex when destroying last instance.') gedi_txt.append(' loader_platform_thread_delete_mutex(&objLock);') gedi_txt.append(' objLockInitialized = 0;') @@ -1587,10 +1587,10 @@ class ObjectTrackerSubcommand(Subcommand): gedd_txt.append(' loader_platform_thread_unlock_mutex(&objLock);') gedd_txt.append('') gedd_txt.append(' dispatch_key key = get_dispatch_key(device);') - gedd_txt.append(' VkLayerDispatchTable *pDisp = get_dispatch_table(ObjectTracker_device_table_map, device);') + gedd_txt.append(' VkLayerDispatchTable *pDisp = get_dispatch_table(object_tracker_device_table_map, device);') gedd_txt.append(' pDisp->DestroyDevice(device, pAllocator);') - gedd_txt.append(' ObjectTracker_device_table_map.erase(key);') - gedd_txt.append(' assert(ObjectTracker_device_table_map.size() == 0 && "Should not have any instance mappings hanging around");') + gedd_txt.append(' object_tracker_device_table_map.erase(key);') + gedd_txt.append(' assert(object_tracker_device_table_map.size() == 0 && "Should not have any instance mappings hanging around");') gedd_txt.append('') gedd_txt.append('}') gedd_txt.append('') @@ -1832,7 +1832,7 @@ class ObjectTrackerSubcommand(Subcommand): '{\n' '%s' '%s' - ' %sget_dispatch_table(ObjectTracker_%s_table_map, %s)->%s;\n' + ' %sget_dispatch_table(object_tracker_%s_table_map, %s)->%s;\n' '%s' '%s' '}' % (qual, decl, using_line, destroy_line, ret_val, table_type, dispatch_param, proto.c_call(), create_line, stmt)) @@ -1841,7 +1841,7 @@ class ObjectTrackerSubcommand(Subcommand): return "\n\n".join(funcs) def generate_body(self): - self.layer_name = "ObjectTracker" + self.layer_name = "object_tracker" extensions=[('wsi_enabled', ['vkCreateSwapchainKHR', 'vkDestroySwapchainKHR', 'vkGetSwapchainImagesKHR', @@ -2028,7 +2028,7 @@ class ThreadingSubcommand(Subcommand): ' for (uint32_t i=0; i%s;\n' % (ret_val, proto.c_call()) + ' for (uint32_t i=0; i%s;\n' % (proto.c_call()) + ' if (result == VK_SUCCESS) {\n' ' layer_data *my_instance_data = get_my_data_ptr(get_dispatch_key(%s), layer_data_map);\n' % proto.params[0].name + @@ -2066,7 +2066,7 @@ class ThreadingSubcommand(Subcommand): funcs.append('%s%s\n' % (qual, decl) + '{\n' ' use%s((const void *) %s, %s);\n' % (proto.params[0].ty, proto.params[0].name, proto.params[0].name) + - ' VkLayerDispatchTable *pDeviceTable = get_dispatch_table(Threading_%s_table_map, %s);\n' % (table, proto.params[0].name) + + ' VkLayerDispatchTable *pDeviceTable = get_dispatch_table(threading_%s_table_map, %s);\n' % (table, proto.params[0].name) + ' %spDeviceTable->%s;\n' % (ret_val, proto.c_call()) + ' finishUsing%s(%s);\n' % (proto.params[0].ty, proto.params[0].name) + '%s' % stmt + @@ -2084,16 +2084,16 @@ class ThreadingSubcommand(Subcommand): funcs.append('%s%s\n' % (qual, decl) + '{\n' ' dispatch_key key = get_dispatch_key(device);\n' - ' VkLayerDispatchTable *pDeviceTable = get_dispatch_table(Threading_%s_table_map, %s);\n' % (table, proto.params[0].name) + + ' VkLayerDispatchTable *pDeviceTable = get_dispatch_table(threading_%s_table_map, %s);\n' % (table, proto.params[0].name) + ' %spDeviceTable->%s;\n' % (ret_val, proto.c_call()) + - ' Threading_device_table_map.erase(key);\n' + ' threading_device_table_map.erase(key);\n' '}\n') return "\n".join(funcs); elif proto.name == "DestroyInstance": funcs.append('%s%s\n' % (qual, decl) + '{\n' ' dispatch_key key = get_dispatch_key(instance);\n' - ' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(Threading_instance_table_map, %s);\n' % proto.params[0].name + + ' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(threading_instance_table_map, %s);\n' % proto.params[0].name + ' %spInstanceTable->%s;\n' % (ret_val, proto.c_call()) + ' destroy_instance_dispatch_table(key);\n' '\n' @@ -2106,13 +2106,13 @@ class ThreadingSubcommand(Subcommand): ' layer_debug_report_destroy_instance(my_data->report_data);\n' ' layer_data_map.erase(pInstanceTable);\n' '\n' - ' Threading_instance_table_map.erase(key);\n' + ' threading_instance_table_map.erase(key);\n' '}\n') return "\n".join(funcs); elif proto.name == "CreateInstance": funcs.append('%s%s\n' '{\n' - ' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(Threading_instance_table_map, *pInstance);\n' + ' VkLayerInstanceDispatchTable *pInstanceTable = get_dispatch_table(threading_instance_table_map, *pInstance);\n' ' VkResult result = pInstanceTable->CreateInstance(pCreateInfo, pAllocator, pInstance);\n' '\n' ' if (result == VK_SUCCESS) {\n' @@ -2122,7 +2122,7 @@ class ThreadingSubcommand(Subcommand): ' *pInstance,\n' ' pCreateInfo->enabledExtensionNameCount,\n' ' pCreateInfo->ppEnabledExtensionNames);\n' - ' initThreading(my_data, pAllocator);\n' + ' init_threading(my_data, pAllocator);\n' ' }\n' ' return result;\n' '}\n' % (qual, decl)) @@ -2135,7 +2135,7 @@ class ThreadingSubcommand(Subcommand): funcs.append('{') for param in checked_params: funcs.append(' use%s((const void *) %s, %s);' % (param.ty, proto.params[0].name, param.name)) - funcs.append(' VkLayerDispatchTable *pDeviceTable = get_dispatch_table(Threading_%s_table_map, %s);' % (table, proto.params[0].name)); + funcs.append(' VkLayerDispatchTable *pDeviceTable = get_dispatch_table(threading_%s_table_map, %s);' % (table, proto.params[0].name)); funcs.append(' %spDeviceTable->%s;' % (ret_val, proto.c_call())) for param in checked_params: funcs.append(' finishUsing%s(%s);' % (param.ty, param.name)) @@ -2144,7 +2144,7 @@ class ThreadingSubcommand(Subcommand): return "\n".join(funcs) def generate_body(self): - self.layer_name = "Threading" + self.layer_name = "threading" body = [self._generate_new_layer_initialization(True, lockname='threading', condname='threading'), self._generate_dispatch_entrypoints("VK_LAYER_EXPORT"), self._generate_layer_gpa_function(extensions=[], @@ -2157,10 +2157,10 @@ class ThreadingSubcommand(Subcommand): def main(): subcommands = { "layer-funcs" : LayerFuncsSubcommand, - "Generic" : GenericLayerSubcommand, - "APIDump" : APIDumpSubcommand, - "ObjectTracker" : ObjectTrackerSubcommand, - "Threading" : ThreadingSubcommand, + "generic" : GenericLayerSubcommand, + "api_dump" : APIDumpSubcommand, + "object_tracker" : ObjectTrackerSubcommand, + "threading" : ThreadingSubcommand, } if len(sys.argv) < 3 or sys.argv[1] not in subcommands or not os.path.exists(sys.argv[2]): -- 2.34.1