Skip to content

Commit 7ec3b87

Browse files
committed
Add skeleton for gpu_timeline layer
1 parent 3ec70da commit 7ec3b87

26 files changed

+2115
-13
lines changed

.github/workflows/build_test.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ jobs:
3030
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
3131
make -j4
3232
33+
- name: Build layer_gpu_timeline
34+
run: |
35+
export CXX=clang++
36+
mkdir layer_gpu_timeline/build_rel
37+
cd layer_gpu_timeline/build_rel
38+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
39+
make -j4
40+
3341
- name: Build and run unit tests
3442
run: |
3543
export CXX=clang++
@@ -56,6 +64,14 @@ jobs:
5664
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
5765
make -j4
5866
67+
- name: Build layer_gpu_timeline
68+
run: |
69+
export CXX=g++
70+
mkdir layer_gpu_timeline/build_rel
71+
cd layer_gpu_timeline/build_rel
72+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
73+
make -j4
74+
5975
build-android:
6076
name: Android
6177
runs-on: ubuntu-22.04

layer_example/source/layer_device_functions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#include <mutex>
2828
#include <thread>
2929

30-
#include "framework/utils.hpp"
31-
3230
#include "device.hpp"
3331
#include "layer_device_functions.hpp"
3432

layer_example/source/layer_device_functions.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,10 @@
2323
* ----------------------------------------------------------------------------
2424
*/
2525

26-
#include <memory>
27-
#include <mutex>
28-
#include <thread>
26+
#include <vulkan/vulkan.h>
2927

30-
#include "framework/device_functions.hpp"
3128
#include "framework/utils.hpp"
3229

33-
#include "device.hpp"
34-
35-
extern std::mutex g_vulkanLock;
36-
3730
/* See Vulkan API for documentation. */
3831
template <>
3932
VKAPI_ATTR void VKAPI_CALL layer_vkCmdBeginRenderPass<user_tag>(

layer_gpu_timeline/CMakeLists.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-License-Identifier: MIT
2+
# -----------------------------------------------------------------------------
3+
# Copyright (c) 2024 Arm Limited
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to
7+
# deal in the Software without restriction, including without limitation the
8+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9+
# sell copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
# -----------------------------------------------------------------------------
23+
24+
cmake_minimum_required(VERSION 3.17)
25+
26+
set(CMAKE_CXX_STANDARD 20)
27+
28+
project(VkLayerGPUTimeline VERSION 1.0.0)
29+
30+
# Common configuration
31+
set(LGL_LOG_TAG, "VkLayerGPUTimeline")
32+
include(../source_common/compiler_helper.cmake)
33+
34+
# Build steps
35+
add_subdirectory(source)
36+
add_subdirectory(../source_common/framework source_common/framework)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: MIT
3+
# ----------------------------------------------------------------------------
4+
# Copyright (c) 2024 Arm Limited
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to
8+
# deal in the Software without restriction, including without limitation the
9+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10+
# sell copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in
14+
# all copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22+
# IN THE SOFTWARE.
23+
# ----------------------------------------------------------------------------
24+
25+
# ----------------------------------------------------------------------------
26+
# Configuration
27+
28+
# Exit immediately if any component command errors
29+
set -e
30+
31+
BUILD_DIR_64=build_arm64
32+
BUILD_DIR_PACK=build_package
33+
34+
# ----------------------------------------------------------------------------
35+
# Process command line options
36+
if [ "$#" -lt 1 ]; then
37+
BUILD_TYPE=Release
38+
else
39+
BUILD_TYPE=$1
40+
fi
41+
42+
# Process command line options
43+
if [ "$#" -lt 2 ]; then
44+
PACKAGE=0
45+
else
46+
PACKAGE=$2
47+
fi
48+
49+
if [ "${PACKAGE}" -gt "0" ]; then
50+
echo "Building a ${BUILD_TYPE} build with packaging"
51+
else
52+
echo "Building a ${BUILD_TYPE} build without packaging"
53+
fi
54+
55+
# ----------------------------------------------------------------------------
56+
# Build the 64-bit layer
57+
mkdir -p ${BUILD_DIR_64}
58+
pushd ${BUILD_DIR_64}
59+
60+
cmake \
61+
-DCMAKE_SYSTEM_NAME=Android \
62+
-DANDROID_PLATFORM=29 \
63+
-DANDROID_ABI=arm64-v8a \
64+
-DANDROID_TOOLCHAIN=clang \
65+
-DANDROID_STL=c++_static \
66+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
67+
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" \
68+
..
69+
70+
make -j1
71+
72+
popd
73+
74+
# ----------------------------------------------------------------------------
75+
# Build the release package
76+
if [ "${PACKAGE}" -gt "0" ]; then
77+
# Setup the package directories
78+
mkdir -p ${BUILD_DIR_PACK}/bin/android/arm64
79+
80+
# Install the 64-bit layer
81+
cp ${BUILD_DIR_64}/source/*.so ${BUILD_DIR_PACK}/bin/android/arm64
82+
fi

0 commit comments

Comments
 (0)