Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fa6c959
vkconfig: Bundle the Vulkan Loader on macOS
christophe-lunarg Oct 28, 2026
4cc2ebc
vkconfig: Hide macOS Dock icon when running in the system tray
christophe-lunarg Oct 28, 2026
607244d
vkconfig: Use a single toggle action for external layer settings file
christophe-lunarg Oct 28, 2026
88fe8c9
vkconfig: Update application icon with transparency
christophe-lunarg Oct 28, 2026
f91f92d
vkconfig: Fix layer manifest validation when disabled
christophe-lunarg Oct 28, 2026
eb6bf93
vkconfig: Fix expanded state not updating on settings reset
herlience Aug 18, 2026
5cc4a5a
vkconfig: Use manifest expanded state as default and on reset
christophe-lunarg Oct 28, 2026
33e0bcf
build: Remove redundant GTest::gtest link from tests
christophe-lunarg Oct 29, 2026
c429e6a
docs: Update changelog
christophe-lunarg Oct 29, 2026
a773830
vkconfig: Fix preset display after layer settings reset
christophe-lunarg Oct 29, 2026
38b1c57
vkconfig: Fix 'layers --list-verbose' showing help
christophe-lunarg Oct 29, 2026
ef0020a
vkconfig: Add 'layers --path' listing layers search locations
christophe-lunarg Oct 29, 2026
af84cf9
vkconfig: Fix invalid VULKAN_SDK layers path when unset
christophe-lunarg Oct 29, 2026
29b4acf
vkconfig: Update Portability to desktop baseline 2026 profile
christophe-lunarg Oct 30, 2026
f651a5e
vkconfig: Improve layer manifest validation reporting
christophe-lunarg Oct 30, 2026
5ee42aa
vkconfig: Fix layer versions and same version layers display
christophe-lunarg Nov 4, 2026
f7bc599
monitor: Draw frame stats as an overlay
jpr42 Oct 29, 2026
2ddc1fd
monitor: Fix review findings in present, swapchain and test setup
jpr42 Oct 30, 2026
f3353fc
monitor: Address review feedback
jpr42 Nov 4, 2026
4efc45f
Merge remote-tracking branch 'upstream/main' into sync-upstream
csteinberg-samsung Nov 6, 2026
6045819
Fix redefines of NOMINMAX and WIN32_LEAN_AND_MEAN
csteinberg-samsung Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- run: cmake --install build --prefix build/install

android:
runs-on: macos-latest
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v7
Expand Down
38 changes: 11 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN "YES")

include(GNUInstallDirs)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Remove when CMake min is 3.26

option(BUILD_WERROR "Treat compiler warnings as errors")
if (BUILD_WERROR)
Expand Down Expand Up @@ -94,46 +94,30 @@ if (MSVC)
add_link_options("$<$<CONFIG:Release>:/DEBUG:FULL>")
endif()

if (CMAKE_SYSTEM_NAME MATCHES "Windows|Linux|BSD")
option(BUILD_APIDUMP "Build api_dump layer" ON)
option(BUILD_MONITOR "Build monitor layer" ON)
option(BUILD_SCREENSHOT "Build screenshot layer" ON)

option(BUILD_APIDUMP "Build api_dump layer" ON)
option(BUILD_MONITOR "Build monitor layer" ON)
option(BUILD_SCREENSHOT "Build screenshot layer" ON)
if (CMAKE_SYSTEM_NAME MATCHES "Windows|Linux|BSD|Darwin")
option(BUILD_LAYERMGR "Build Vulkan Configurator" ON)
set(SDK_VERSION "" CACHE STRING "Vulkan SDK version")

elseif(ANDROID)

# Currently the Android build only build the API dump and screen shot layer.
# - libVkLayer_api_dump.so
# - libVkLayer_screenshot.so
option(BUILD_APIDUMP "Build api_dump layer" ON)
option(BUILD_SCREENSHOT "Build screenshot layer" ON)
set(BUILD_MONITOR OFF)
else()
message(DEBUG "VkConfig only supported on desktop platforms")
set(BUILD_LAYERMGR OFF)

elseif (APPLE)

option(BUILD_APIDUMP "Build api_dump layer" ON)
option(BUILD_SCREENSHOT "Build screenshot layer" ON)
set(BUILD_MONITOR OFF)

if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
option(BUILD_LAYERMGR "Build Vulkan Configurator" ON)
endif()

endif()

if(BUILD_TESTS)
add_subdirectory(tests)
endif()

if(BUILD_APIDUMP OR BUILD_MONITOR OR BUILD_SCREENSHOT)
message(STATUS "INFO: Building Vulkan Layers")
add_subdirectory(layersvt)
endif()

if(BUILD_LAYERMGR)
# Provided when building SDK to get the Vulkan SDK version for the Vulkan Configurator
# Useful metadata to have for the Vulkan Configurator build
set(SDK_VERSION "" CACHE STRING "Vulkan SDK version")

if(NOT Qt6_FOUND)
message("WARNING: Vulkan Configurator will be excluded from the build because Qt6 was not found. Please add Qt6 into the PATH environment variable")
else()
Expand Down
68 changes: 52 additions & 16 deletions layersvt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
file(GLOB IMAGES "${PROJECT_SOURCE_DIR}/layersvt/images/*")
file(COPY ${IMAGES} DESTINATION ${CMAKE_BINARY_DIR}/layersvt/images)

set(CMAKE_FOLDER "${CMAKE_FOLDER}/layers")

if(WIN32)
add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR)
# Minimize what Windows.h leaks
Expand Down Expand Up @@ -43,18 +45,23 @@ else()
add_compile_options(-Wpointer-arith)
endif()

# Vulkan Layers are typically built as MODULEs, except on iOS where they are SHARED libraries
# From the CMake docs: "A Module Library: a plugin that may not be linked by other targets, but may be dynamically loaded at runtime using dlopen-like functionality."
# This exactly describes a Vulkan layer. In particular, it is a plugin that is dynamically loaded by the Vulkan loader at runtime and is not linked by other targets.
# On WIN32 when installing the layers specifying libraries as MODULE avoids installing the import library (.lib) that would be generated for SHARED libraries.
set(VK_LAYER_TYPE "MODULE")
if (IOS)
# "Apples App store rules require dynamic libraries be packaged as Frameworks for iOS.
# This requirement is not applied for macOS, so all iOS libraries should be packaged as Frameworks moving forward to comply with Apples policy."
set(VK_LAYER_TYPE "SHARED")
endif()

if(BUILD_APIDUMP)
find_package(Python3 REQUIRED)

set(VULKAN_REGISTRY "${VULKAN_HEADERS_INSTALL_DIR}/${CMAKE_INSTALL_DATADIR}/vulkan/registry")

if(IOS)
add_library(VkLayer_api_dump SHARED)
else()
add_library(VkLayer_api_dump MODULE)
endif()
set_target_properties(VkLayer_api_dump PROPERTIES FOLDER "layers/api_dump")

add_library(VkLayer_api_dump "${VK_LAYER_TYPE}")
target_sources(VkLayer_api_dump PRIVATE
api_dump_handwritten_dispatch.cpp
generated/api_dump_dispatch.h
Expand Down Expand Up @@ -91,20 +98,47 @@ if(BUILD_APIDUMP)
endif ()

if(BUILD_MONITOR)
add_library(VkLayer_monitor MODULE)
set_target_properties(VkLayer_monitor PROPERTIES FOLDER "layers/monitor")
target_sources(VkLayer_monitor PRIVATE
monitor.cpp
# Everything but the exported entry points, so the unit tests can link it too
add_library(VkLayer_monitor_core STATIC)
target_sources(VkLayer_monitor_core PRIVATE
monitor_layer.cpp
monitor_layer.h
monitor_overlay.cpp
monitor_overlay.h
monitor_overlay_shaders.h
monitor_present.cpp
monitor_present.h
monitor_renderer.cpp
monitor_renderer.h
monitor_settings.cpp
monitor_settings.h
shaders/monitor_overlay.vert
shaders/monitor_overlay.frag
vk_layer_table.cpp
vk_layer_table.h
)
target_include_directories(VkLayer_monitor_core PUBLIC .)
target_link_libraries(VkLayer_monitor_core PUBLIC Vulkan::Headers Vulkan::UtilityHeaders Vulkan::LayerSettings)
if (ANDROID)
target_link_libraries(VkLayer_monitor_core PUBLIC log)
endif()
# The dispatch table's layout depends on the VK_USE_PLATFORM_* definitions above, so code linking the core, like the
# unit tests in tests/monitor, has to be compiled with the same ones
get_directory_property(LAYER_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)
target_compile_definitions(VkLayer_monitor_core INTERFACE ${LAYER_COMPILE_DEFINITIONS})
# The monitor layer itself remains small with only the exported entry points, while the core functionality is in the static library.
# This separation allows the core functionality to be reused by unit tests and other components without requiring the full layer to be linked.
add_library(VkLayer_monitor "${VK_LAYER_TYPE}")
target_sources(VkLayer_monitor PRIVATE
monitor.cpp
monitor_layer.md
json/VkLayer_monitor.json.in
)
target_link_libraries(VkLayer_monitor PRIVATE VkLayer_monitor_core)
endif ()

if(BUILD_SCREENSHOT)
add_library(VkLayer_screenshot MODULE)
set_target_properties(VkLayer_screenshot PROPERTIES FOLDER "layers/screenshot")
add_library(VkLayer_screenshot "${VK_LAYER_TYPE}")
target_sources(VkLayer_screenshot PRIVATE
screenshot.cpp
screenshot_parsing.cpp
Expand All @@ -126,6 +160,8 @@ foreach(layer ${TOOL_LAYERS})
continue()
endif()

message(DEBUG "Configuring Vulkan layer ${layer}")

target_link_Libraries(${layer} PRIVATE Vulkan::Headers Vulkan::UtilityHeaders Vulkan::LayerSettings)

if (ANDROID)
Expand All @@ -144,10 +180,10 @@ foreach(layer ${TOOL_LAYERS})
# IOS and APPLE can both be true (FYI)
if(IOS)
set_target_properties(${layer} PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_BUNDLE_VERSION "${VulkanHeaders_VERSION}"
FRAMEWORK TRUE
MACOSX_FRAMEWORK_BUNDLE_VERSION "${VulkanHeaders_VERSION}"
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${VulkanHeaders_VERSION}"
MACOSX_FRAMEWORK_IDENTIFIER com.khronos.${layer}
MACOSX_FRAMEWORK_IDENTIFIER com.khronos.${layer}
)
else()
set_target_properties(${layer} PROPERTIES SUFFIX ".dylib")
Expand Down
20 changes: 8 additions & 12 deletions layersvt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,20 @@ Note that some layers are code-generated and will therefore exist in the directo
layersvt/screenshot.cpp (name='VK_LAYER_LUNARG_screenshot') - utility layer used to capture and save screenshots of running applications.
To specify frames to be captured, the environment variable 'VK_SCREENSHOT_FRAMES' can be set to a comma-separated list of frame numbers (ex: 4,8,15,16,23,42).

### View Frames Per Second
layersvt/monitor.cpp - utility layer that will display an applications FPS in the title bar of a windowed application.
### Monitor Frames Per Second
layersvt/monitor.cpp - utility layer that draws an application's FPS, frame time and frame number on top of the images it presents.

## Using Layers

1. Build VK loader using normal steps (cmake and make)
2. Place libVkLayer_<name>.so or VkLayer_<name>.dll in the same directory as your Vulkan test or application, or use the VK\_LAYER\_PATH environment variable to specify where the layer libraries reside.
2. Place `libVkLayer_<name>.so` or `VkLayer_<name>.dll` in the same directory as your Vulkan test or application, or use the `VK_LAYER_PATH` environment variable to specify where the layer libraries reside.
3. Create a vk_layer_settings.txt file in the same directory to specify how your layers should behave.

Model it after the following example: [*vk_layer_settings.txt*](vk_layer_settings.txt)

4. Specify which Layers to activate by using
vkCreateDevice and/or vkCreateInstance or environment variables.
4. Specify which Layers to activate by using vkCreateDevice and/or vkCreateInstance or environment variables.

export VK\_INSTANCE\_LAYERS=VK_LAYER_LUNARG_api_dump
cd build/tests; ./vkinfo

## Status


### Current known issues
```sh
export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_api_dump
vulkaninfo
```
4 changes: 4 additions & 0 deletions layersvt/VKLayer_monitor.def
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ LIBRARY VkLayer_monitor
EXPORTS
vkGetInstanceProcAddr
vkGetDeviceProcAddr
vkEnumerateInstanceLayerProperties
vkEnumerateDeviceLayerProperties
vkEnumerateInstanceExtensionProperties
vkEnumerateDeviceExtensionProperties

4 changes: 4 additions & 0 deletions layersvt/api_dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@
#if defined(_WIN32)
// Used by GetCurrentProcessName. NOMINMAX avoids windows.h's min/max macros shadowing std::min/max,
// used throughout this header.
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif

Expand Down
92 changes: 88 additions & 4 deletions layersvt/json/VkLayer_monitor.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"type": "GLOBAL",
"library_path": "@JSON_LIBRARY_PATH@",
"api_version": "@JSON_VERSION@",
"implementation_version": "1",
"implementation_version": "2",
"description": "Execution Monitoring Layer",
"introduction": "The monitor utility layer displays the real-time frame rate in frames-per-second in the application's title bar.",
"introduction": "The monitor utility layer draws the frame rate, frame time and frame number on top of the images the application presents.",
"url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/monitor_layer.html",
"platforms": [ "WINDOWS", "LINUX" ],
"platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ],
"instance_extensions": [
{
"name": "VK_EXT_layer_settings",
Expand All @@ -24,6 +24,90 @@
"vkGetPhysicalDeviceToolPropertiesEXT"
]
}
]
],
"features": {
"settings": [
{
"key": "position",
"label": "Position",
"description": "Corner of the presented image the overlay is drawn in.",
"type": "ENUM",
"flags": [
{
"key": "TOP_LEFT",
"label": "Top Left",
"description": "Draw the overlay in the top left corner."
},
{
"key": "TOP_RIGHT",
"label": "Top Right",
"description": "Draw the overlay in the top right corner."
},
{
"key": "BOTTOM_LEFT",
"label": "Bottom Left",
"description": "Draw the overlay in the bottom left corner."
},
{
"key": "BOTTOM_RIGHT",
"label": "Bottom Right",
"description": "Draw the overlay in the bottom right corner."
}
],
"default": "TOP_LEFT"
},
{
"key": "scale",
"label": "Scale",
"description": "Size of the overlay text, as a percentage of the default size. The default size grows with the resolution of the presented images. Text is drawn in whole pixels, so the size changes in steps.",
"type": "INT",
"default": 100,
"range": {
"min": 50,
"max": 400
},
"unit": "%"
},
{
"key": "update_interval_ms",
"label": "Update Interval",
"description": "How often the frame rate and frame times are updated. The frame number is updated every frame.",
"type": "INT",
"default": 500,
"range": {
"min": 50
},
"unit": "ms"
},
{
"key": "show_fps",
"label": "Show Frame Rate",
"description": "Show the frame rate in frames per second.",
"type": "BOOL",
"default": true
},
{
"key": "show_frame_time",
"label": "Show Frame Time",
"description": "Show the average frame time in milliseconds, with the shortest and longest frame time.",
"type": "BOOL",
"default": true
},
{
"key": "show_frame_number",
"label": "Show Frame Number",
"description": "Show the number of the frame being presented. Frame 0 is the first presented image.",
"type": "BOOL",
"default": true
},
{
"key": "log_warnings",
"label": "Log Warnings",
"description": "Print why the overlay isn't shown on some swapchains, once per reason.",
"type": "BOOL",
"default": false
}
]
}
}
}
Loading
Loading