Skip to content
Open
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
10 changes: 6 additions & 4 deletions layersvt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ else()
add_compile_options(-Wpointer-arith)
endif()

add_subdirectory(common)

if(BUILD_APIDUMP)
find_package(Python3 REQUIRED)

Expand Down Expand Up @@ -116,7 +118,7 @@ if(BUILD_SCREENSHOT)
vk_layer_table.cpp
vk_layer_table.h
screenshot/screenshot_layer.md
layer_keep_alive.cpp
common/layer_keep_alive.cpp
screenshot/json/VkLayer_screenshot.json.in
)
endif()
Expand All @@ -136,7 +138,7 @@ if(BUILD_CPUTIMING)
../scripts/generators/cputiming_generator.py
vk_layer_table.cpp
vk_layer_table.h
layer_keep_alive.cpp
common/layer_keep_alive.cpp
cpu_timing/VkLayer_CPUTiming.json.in
)

Expand Down Expand Up @@ -178,7 +180,7 @@ if(BUILD_DEBUGMARKER)
perfetto/perfetto.cc
vk_layer_table.cpp
vk_layer_table.h
layer_keep_alive.cpp
common/layer_keep_alive.cpp
debug_marker/VkLayer_DebugMarker.json.in
)

Expand Down Expand Up @@ -214,7 +216,7 @@ if(BUILD_DEVICEMEMORYREPORT)
perfetto/perfetto.cc
vk_layer_table.cpp
vk_layer_table.h
layer_keep_alive.cpp
common/layer_keep_alive.cpp
device_memory_report/VkLayer_DeviceMemoryReport.json.in
)

Expand Down
1 change: 1 addition & 0 deletions layersvt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Layers are activated at vkCreateInstance time. Layers can also be activated via
Note that some layers are code-generated and will therefore exist in the directory (build_dir)/layers

-include/vkLayer.h - header file for layer code.
- [common/README.md](common/README.md) - Common layer foundation library (`layersvt_common`) and guide for creating new layers.

### Print API Calls and Parameter Values
(build dir)/layers/api_dump.cpp (name=VK_LAYER_LUNARG_api_dump) - print out API calls along with parameter values
Expand Down
55 changes: 55 additions & 0 deletions layersvt/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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.

add_library(layersvt_common OBJECT
dispatch_table_manager.h
dispatch_table_manager.cpp
layer_manifest.h
layer_manifest.cpp
layer_base.h
layer_base.cpp
dispatch_downstream.h
)

set_target_properties(layersvt_common PROPERTIES
FOLDER "layers/common"
POSITION_INDEPENDENT_CODE ON
)

target_include_directories(layersvt_common PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/..
)

target_link_libraries(layersvt_common PUBLIC
Vulkan::Headers
Vulkan::UtilityHeaders
)
if (ANDROID)
target_sources(layersvt_common PRIVATE
layer_keep_alive.cpp
)
target_link_libraries(layersvt_common PUBLIC ${CMAKE_DL_LIBS})
endif()

add_library(layersvt_entrypoints OBJECT
layer_entrypoints.cpp
)

set_target_properties(layersvt_entrypoints PROPERTIES
FOLDER "layers/common"
)

target_link_libraries(layersvt_entrypoints PRIVATE
layersvt_common
)
Loading
Loading