Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f38769b
Vulkan Memory Report layer: Vulkan Memory by Usage Type
jimblacklercorp Aug 11, 2026
2ef181f
Set Perfetto counter unit to bytes for memory allocations
jimblacklercorp Aug 11, 2026
86e0cfa
Correctly account for memory bound in a shared allocation.
jimblacklercorp Aug 12, 2026
aa4278f
Enable the memory report only on Android.
jimblacklercorp Aug 25, 2026
2c3e520
Eagerly enumerate physical devices in vkCreateInstance
jimblacklercorp Aug 25, 2026
8d29b2e
Remove code and comments remaining in error from debug object work.
jimblacklercorp Aug 25, 2026
e8e74f2
Use physicalDevice directly for instance dispatch table lookup
jimblacklercorp Aug 25, 2026
5bc1f65
Make Perfetto SDK initialization thread-safe using std::call_once
jimblacklercorp Aug 26, 2026
52c3ff7
Use static lookup map for Perfetto CounterTracks to avoid dynamic all…
jimblacklercorp Aug 26, 2026
bda7e1f
Remove redundant vkEnumerateDeviceExtensionProperties layer intercept
jimblacklercorp Aug 26, 2026
53c993a
Add GetBufferCluster and GetImageCluster memory classification functions
jimblacklercorp Aug 26, 2026
0ce16a8
Integrate memory properties capture and cluster classification into r…
jimblacklercorp Aug 26, 2026
75beb15
Rename Perfetto category to VulkanDeviceMemoryReport
jimblacklercorp Aug 27, 2026
7a2c1b5
Add comments explaining physical device trampoline in GetVkInstance
jimblacklercorp Aug 27, 2026
89f3a5a
Document total_size logic in SetAllocationMemoryProperties
jimblacklercorp Aug 27, 2026
88e7ae2
Remove eager physical device enumeration and simplify GetVkInstance
jimblacklercorp Aug 27, 2026
90739be
Merge branch 'main' into vulkan-memory-report
olehkuznetsov Sep 1, 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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows|Linux|BSD")
if(NOT WIN32)
option(BUILD_CPUTIMING "Build CPUTiming layer" ON)
option(BUILD_DEBUGMARKER "Build DebugMarker layer" ON)
option(BUILD_DEVICEMEMORYREPORT "Build DeviceMemoryReport layer" OFF)
endif()
option(BUILD_LAYERMGR "Build Vulkan Configurator" ON)
set(SDK_VERSION "" CACHE STRING "Vulkan SDK version")
Expand All @@ -108,6 +109,7 @@ elseif(ANDROID)
option(BUILD_SCREENSHOT "Build screenshot layer" ON)
option(BUILD_CPUTIMING "Build CPUTiming layer" ON)
option(BUILD_DEBUGMARKER "Build DebugMarker layer" ON)
option(BUILD_DEVICEMEMORYREPORT "Build DeviceMemoryReport layer" ON)
set(BUILD_MONITOR OFF)
set(BUILD_LAYERMGR OFF)

Expand All @@ -127,7 +129,7 @@ if(BUILD_TESTS)
add_subdirectory(tests)
endif()

if(BUILD_APIDUMP OR BUILD_MONITOR OR BUILD_SCREENSHOT OR BUILD_CPUTIMING OR BUILD_DEBUGMARKER)
if(BUILD_APIDUMP OR BUILD_MONITOR OR BUILD_SCREENSHOT OR BUILD_CPUTIMING OR BUILD_DEBUGMARKER OR BUILD_DEVICEMEMORYREPORT)
message(STATUS "INFO: Building Vulkan Layers")
add_subdirectory(layersvt)
endif()
Expand Down
42 changes: 41 additions & 1 deletion layersvt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,47 @@ if(BUILD_DEBUGMARKER)
target_compile_definitions(VkLayer_DebugMarker PRIVATE VK_ENABLE_BETA_EXTENSIONS)
endif()

if(BUILD_DEVICEMEMORYREPORT)
add_library(VkLayer_DeviceMemoryReport MODULE)
set_target_properties(VkLayer_DeviceMemoryReport PROPERTIES FOLDER "layers/devicememoryreport")
target_sources(VkLayer_DeviceMemoryReport PRIVATE
device_memory_report/device_memory_report_handwritten_dispatch.cpp
device_memory_report/device_memory_report_handwritten_functions.h
device_memory_report/device_memory_report.h
device_memory_report/device_memory_report.cpp
device_memory_report/device_memory_report_perfetto.h
device_memory_report/device_memory_report_perfetto.cpp
perfetto/perfetto.cc
vk_layer_table.cpp
vk_layer_table.h
layer_keep_alive.cpp
device_memory_report/VkLayer_DeviceMemoryReport.json.in
)

target_include_directories(VkLayer_DeviceMemoryReport PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/device_memory_report
${CMAKE_CURRENT_BINARY_DIR}
)

if(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU")
if (BUILD_WSI_XCB_SUPPORT)
target_compile_definitions(VkLayer_DeviceMemoryReport PRIVATE VK_USE_PLATFORM_XLIB_KHR)
endif()

if (BUILD_WSI_WAYLAND_SUPPORT)
target_compile_definitions(VkLayer_DeviceMemoryReport PRIVATE VK_USE_PLATFORM_WAYLAND_KHR)
endif()
endif()

target_compile_definitions(VkLayer_DeviceMemoryReport PRIVATE VK_ENABLE_BETA_EXTENSIONS)
endif()

if (BUILD_TESTS AND NOT RUN_ON_GITHUB)
add_subdirectory(test)
endif()

list(APPEND TOOL_LAYERS "VkLayer_api_dump" "VkLayer_screenshot" "VkLayer_monitor" "VkLayer_CPUTiming" "VkLayer_DebugMarker")
list(APPEND TOOL_LAYERS "VkLayer_api_dump" "VkLayer_screenshot" "VkLayer_monitor" "VkLayer_CPUTiming" "VkLayer_DebugMarker" "VkLayer_DeviceMemoryReport")
foreach(layer ${TOOL_LAYERS})
if (NOT TARGET "${layer}")
continue()
Expand All @@ -217,6 +253,8 @@ foreach(layer ${TOOL_LAYERS})
set(layer_dir "cpu_timing/")
elseif(layer STREQUAL "VkLayer_screenshot")
set(layer_dir "screenshot/")
elseif(layer STREQUAL "VkLayer_DeviceMemoryReport")
set(layer_dir "device_memory_report/")
else()
set(layer_dir "")
endif()
Expand Down Expand Up @@ -265,6 +303,8 @@ foreach(layer ${TOOL_LAYERS})
set(INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpu_timing/${layer}.json.in")
elseif(layer STREQUAL "VkLayer_screenshot")
set(INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/screenshot/json/${layer}.json.in")
elseif(layer STREQUAL "VkLayer_DeviceMemoryReport")
set(INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/device_memory_report/${layer}.json.in")
else()
set(INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/json/${layer}.json.in")
endif()
Expand Down
21 changes: 21 additions & 0 deletions layersvt/device_memory_report/VkLayer_DeviceMemoryReport.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; Copyright (C) 2026 Google Inc.
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.

LIBRARY VkLayer_DeviceMemoryReport
EXPORTS
vkGetInstanceProcAddr
vkGetDeviceProcAddr
vkEnumerateInstanceExtensionProperties
vkEnumerateInstanceLayerProperties
vkEnumerateDeviceLayerProperties
17 changes: 17 additions & 0 deletions layersvt/device_memory_report/VkLayer_DeviceMemoryReport.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"file_format_version" : "1.2.0",
"layer" : {
"name": "VK_LAYER_GOOGLE_DeviceMemoryReport",
"type": "GLOBAL",
"library_path": "@JSON_LIBRARY_PATH@",
"api_version": "@JSON_VERSION@",
"implementation_version": "1",
"description": "Vulkan Device Memory Report Layer",
"device_extensions": [
{
"name": "VK_EXT_device_memory_report",
"spec_version": "2"
}
]
}
}
Loading
Loading