Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@
[submodule "External/tabler-icons"]
path = External/tabler-icons
url = https://github.com/tabler/tabler-icons
[submodule "External/Vulkan-Tools"]
path = External/Vulkan-Tools
url = https://github.com/KhronosGroup/Vulkan-Tools
27 changes: 21 additions & 6 deletions External/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,25 @@ if (UNIX)
endif ()

# KhronosGroup/Vulkan-Headers
add_subdirectory (Vulkan-Headers)
set (VULKAN_HEADERS_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers" PARENT_SCOPE)
execute_process (COMMAND "${CMAKE_COMMAND}"
-S "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers"
-B "${CMAKE_CURRENT_BINARY_DIR}/Vulkan-Headers"
OUTPUT_QUIET)

execute_process (COMMAND "${CMAKE_COMMAND}"
--install "${CMAKE_CURRENT_BINARY_DIR}/Vulkan-Headers"
--prefix "${CMAKE_CURRENT_BINARY_DIR}/install"
OUTPUT_QUIET)

set (VULKAN_HEADERS_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/install")
set (VULKAN_HEADERS_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/install" PARENT_SCOPE)

# KhronosGroup/Vulkan-Tools
set (BUILD_CUBE OFF)
set (BUILD_VULKANINFO OFF)
set (BUILD_TESTS OFF)

add_subdirectory (Vulkan-Tools)

# KhronosGroup/Vulkan-Utility-Libraries
add_subdirectory (Vulkan-Utility-Libraries)
Expand Down Expand Up @@ -131,15 +148,13 @@ add_library (imgui STATIC
target_include_directories (imgui
PUBLIC imgui
PUBLIC imgui/backends
PUBLIC imgui/misc/cpp)
PUBLIC imgui/misc/cpp
PRIVATE "${VULKAN_HEADERS_INSTALL_DIR}/include")

target_compile_definitions (imgui
PUBLIC IMGUI_USER_CONFIG="${CMAKE_CURRENT_SOURCE_DIR}/imgui_config.h"
PRIVATE VK_NO_PROTOTYPES=1)

target_link_libraries (imgui
PUBLIC Vulkan-Headers)

# lstalmir/imgui-text-editor
add_library (imgui-text-editor STATIC
imgui-text-editor/TextEditor.h
Expand Down
1 change: 1 addition & 0 deletions External/Vulkan-Tools
Submodule Vulkan-Tools added at 8542e6
11 changes: 8 additions & 3 deletions VkLayer_profiler_layer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cmake_minimum_required (VERSION 3.8...3.31)

find_package (Python3 REQUIRED)

include (GNUInstallDirs)
include ("${CMAKE_SOURCE_DIR}/CMake/check_python_module.cmake")

set (PROFILER_LAYER_VER_MAJOR 1)
Expand Down Expand Up @@ -121,9 +122,9 @@ add_custom_command (
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vk_dispatch_tables.h"
COMMAND "${Python3_EXECUTABLE}"
"${PROFILER_SCRIPTS_DIR}/gen_dispatch_tables.py"
"${VULKAN_HEADERS_INSTALL_DIR}"
"${VULKAN_HEADERS_INSTALL_DIR}/${CMAKE_INSTALL_DATADIR}/vulkan/registry/vk.xml"
"${CMAKE_CURRENT_BINARY_DIR}"
DEPENDS "${VULKAN_HEADERS_INSTALL_DIR}/registry/vk.xml"
DEPENDS "${VULKAN_HEADERS_INSTALL_DIR}/${CMAKE_INSTALL_DATADIR}/vulkan/registry/vk.xml"
DEPENDS "${PROFILER_SCRIPTS_DIR}/gen_dispatch_tables.py")
list (APPEND PROFILER_CODEGEN_FILES "${CMAKE_CURRENT_BINARY_DIR}/vk_dispatch_tables.h")

Expand Down Expand Up @@ -177,7 +178,6 @@ add_custom_target (profiler_codegen

add_library (profiler_common INTERFACE)
target_link_libraries (profiler_common
INTERFACE Vulkan-Headers
INTERFACE VulkanUtilityHeaders
INTERFACE VulkanLayerSettings
INTERFACE VulkanMemoryAllocator
Expand All @@ -190,6 +190,7 @@ target_link_libraries (profiler_common
target_include_directories (profiler_common
INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}"
INTERFACE "${CMAKE_CURRENT_BINARY_DIR}"
INTERFACE "${VULKAN_HEADERS_INSTALL_DIR}/include"
INTERFACE utils)
target_compile_definitions (profiler_common INTERFACE
$<$<CONFIG:Debug>:PROFILER_CONFIG_DEBUG>
Expand Down Expand Up @@ -366,6 +367,10 @@ target_link_libraries (${PROFILER_LAYER_PROJECTNAME}_lib
target_link_libraries (${PROFILER_LAYER_PROJECTNAME}
PRIVATE ${PROFILER_LAYER_PROJECTNAME}_lib)

add_custom_command (TARGET ${PROFILER_LAYER_PROJECTNAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"${json}" "$<TARGET_FILE_DIR:${PROFILER_LAYER_PROJECTNAME}>/${PROFILER_LAYER_PROJECTNAME}.json")

# Set include path
target_include_directories (${PROFILER_LAYER_PROJECTNAME}_lib
PUBLIC "${VULKAN_HEADERS_INCLUDE_DIR}"
Expand Down
1 change: 1 addition & 0 deletions VkLayer_profiler_layer/profiler_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ if (BUILD_TESTS)

add_dependencies (profiler_tests profiler_tests_shaders)
add_dependencies (profiler_tests VkLayer_profiler_layer)
add_dependencies (profiler_tests VkICD_mock_icd)

target_link_libraries (profiler_tests
PRIVATE ${Vulkan_LIBRARIES}
Expand Down
5 changes: 2 additions & 3 deletions VkLayer_profiler_layer/scripts/gen_dispatch_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import xml.etree.ElementTree as etree

# Read configuration variables
VULKAN_HEADERS_DIR = os.path.abspath( sys.argv[ 1 ] )
VULKAN_REGISTRY_XML_PATH = os.path.abspath( sys.argv[ 1 ] )
CMAKE_CURRENT_BINARY_DIR = os.path.abspath( sys.argv[ 2 ] )

class VulkanSpec:
Expand Down Expand Up @@ -155,8 +155,7 @@ def write_extension_commands( self, out: io.TextIOBase, extension: str, commands
# Generate dispatch tables
def gen_dispatch_tables():
out_path = os.path.join( CMAKE_CURRENT_BINARY_DIR, "vk_dispatch_tables.h" )
vk_xml_path = os.path.join( VULKAN_HEADERS_DIR, "registry", "vk.xml" )
vk_xml = etree.parse( vk_xml_path )
vk_xml = etree.parse( VULKAN_REGISTRY_XML_PATH )
generator = DispatchTableGenerator( vk_xml )
with open( out_path, mode="w" ) as out:
generator.write_commands( out )
Expand Down