Skip to content

Commit fec2d81

Browse files
authored
Version 0.2.0
- Convert code to C++. - Use Cap'n Proto to send the data over the network.
1 parent 2032326 commit fec2d81

24 files changed

+390
-309
lines changed

.appveyor.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.1.0[{build}]
1+
version: 0.2.0[{build}]
22

33
clone_depth: 1
44

@@ -9,32 +9,40 @@ branches:
99

1010
cache:
1111
- c:\usr
12+
- c:\tools\vcpkg\installed\
1213

13-
image: Visual Studio 2019
14+
image: Visual Studio 2017
15+
16+
platform:
17+
- x64
18+
19+
configuration:
20+
- Debug
21+
- Release
1422

1523
environment:
1624
VULKAN_SDK: C:\VulkanSDK\1.2.135.0
1725
matrix:
18-
- CMAKE_VS_VERSION: "16 2019"
26+
- CMAKE_VS_VERSION: "15 2017"
1927

2028
install:
2129
- curl -L --silent --show-error --output VulkanSDK.exe https://vulkan.lunarg.com/sdk/download/1.2.135.0/windows/VulkanSDK-1.2.135.0-Installer.exe?Human=true
2230
- .\VulkanSDK.exe /S
2331
- appveyor DownloadFile https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip -FileName glslangvalidator.zip
2432
- unzip glslangvalidator.zip
2533
- set PATH=%APPVEYOR_BUILD_FOLDER%\bin;%PATH%
26-
27-
platform:
28-
- x86
29-
- x64
30-
configuration:
31-
- Debug
32-
- Release
34+
- cd C:\Tools\vcpkg
35+
- git pull
36+
- .\bootstrap-vcpkg.bat
37+
- cd %APPVEYOR_BUILD_FOLDER%
38+
- vcpkg --disable-metrics install capnproto:%platform%-windows
39+
- cd C:\Tools\vcpkg
40+
- vcpkg --disable-metrics integrate install
41+
- cd %APPVEYOR_BUILD_FOLDER%
3342

3443
before_build:
3544
- git submodule -q update --init --recursive
36-
37-
- cmake -DSTANDALONE=ON -DCMAKE_BUILD_TYPE=%configuration% -G "Visual Studio %CMAKE_VS_VERSION%"
45+
- cmake -DCMAKE_PREFIX_PATH=C:/Tools/vcpkg/packages/capnproto_%platform%-windows/ -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64 -DSTANDALONE=ON -DCMAKE_BUILD_TYPE=%configuration% -G "Visual Studio %CMAKE_VS_VERSION%"
3846

3947
build_script:
4048
project: ALL_BUILD.vcxproj

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ xcuserdata
251251

252252
# Unix
253253

254+
# Virtual env
255+
venv/
256+
254257
# IDEs
255258
.vscode/
256259

.travis.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ addons:
1717
- git-lfs
1818
- doxygen
1919
- ninja
20+
- capnp
2021

2122
env:
2223
global:
2324
- CTEST_EXT_COLOR_OUTPUT=TRUE
2425
- CTEST_BUILD_FLAGS=-j4
26+
- CAPNPROTO_VERSION="0.8.0"
2527

2628
matrix:
2729
include:
@@ -31,21 +33,25 @@ matrix:
3133
env:
3234
- MATRIX_EVAL="CC=gcc && CXX=g++"
3335
- VULKAN_SDK_VER="1.2.135"
36+
- PATH="$PATH:$HOME/capnproto/bin"
37+
- LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/capnproto/lib"
3438

3539
- os: linux
3640
name: Ubuntu Bionic clang
3741
dist: bionic
3842
env:
3943
- MATRIX_EVAL="CC=clang && CXX=clang++"
4044
- VULKAN_SDK_VER="1.2.135"
45+
- PATH="$PATH:$HOME/capnproto/bin"
46+
- LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/capnproto/lib"
4147

4248
- os: osx
4349
name: OSX xcode11.2 gcc
4450
osx_image: xcode11.2
4551
env:
4652
- MATRIX_EVAL="CC=gcc && CXX=g++"
4753
- VULKAN_SDK_VER="1.2.135.0"
48-
- VULKAN_INSTALL_DIR="$HOME/build/vulkansdk-macos-$VULKAN_SDK_VER"
54+
- VULKAN_INSTALL_DIR="$HOME/build/vulkansdk-macos-${VULKAN_SDK_VER}"
4955
- VULKAN_SDK="$VULKAN_INSTALL_DIR/macOS"
5056

5157
- os: osx
@@ -54,7 +60,7 @@ matrix:
5460
env:
5561
- MATRIX_EVAL="CC=clang && CXX=clang++"
5662
- VULKAN_SDK_VER="1.2.135.0"
57-
- VULKAN_INSTALL_DIR="$HOME/build/vulkansdk-macos-$VULKAN_SDK_VER"
63+
- VULKAN_INSTALL_DIR="$HOME/build/vulkansdk-macos-${VULKAN_SDK_VER}"
5864
- VULKAN_SDK="$VULKAN_INSTALL_DIR/macOS"
5965

6066
before_install:
@@ -64,17 +70,24 @@ install:
6470
- |
6571
case "${TRAVIS_OS_NAME:-linux}" in
6672
linux)
67-
# No need to install git-lfs. It is part of Travis's Xenial environment.
6873
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - &&
69-
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-$VULKAN_SDK_VER-xenial.list http://packages.lunarg.com/vulkan/$VULKAN_SDK_VER/lunarg-vulkan-$VULKAN_SDK_VER-xenial.list &&
74+
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${VULKAN_SDK_VER}-bionic.list http://packages.lunarg.com/vulkan/${VULKAN_SDK_VER}/lunarg-vulkan-${VULKAN_SDK_VER}-bionic.list &&
7075
sudo apt update &&
71-
sudo apt install lunarg-vulkan-sdk
76+
sudo apt install vulkan-sdk &&
77+
curl -O https://capnproto.org/capnproto-c++-${CAPNPROTO_VERSION}.tar.gz &&
78+
tar zxf capnproto-c++-${CAPNPROTO_VERSION}.tar.gz &&
79+
cd capnproto-c++-${CAPNPROTO_VERSION} &&
80+
./configure --prefix=$HOME/capnproto &&
81+
make -j3 &&
82+
make install &&
83+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/capnproto/lib &&
84+
cd ../
7285
;;
7386
osx)
7487
# Current directory is .../build/{KhronosGroup,msc-}/KTX-Software. cd to 'build'.
7588
pushd ../.. &&
76-
wget -O vulkansdk-macos-$VULKAN_SDK_VER.tar.gz https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/mac/vulkansdk-macos-$VULKAN_SDK_VER.tar.gz?Human=true &&
77-
tar -xzf vulkansdk-macos-$VULKAN_SDK_VER.tar.gz &&
89+
wget -O vulkansdk-macos-${VULKAN_SDK_VER}.tar.gz https://sdk.lunarg.com/sdk/download/${VULKAN_SDK_VER}/mac/vulkansdk-macos-${VULKAN_SDK_VER}.tar.gz?Human=true &&
90+
tar -xzf vulkansdk-macos-${VULKAN_SDK_VER}.tar.gz &&
7891
wget -O Packages.dmg http://s.sudre.free.fr/Software/files/Packages.dmg &&
7992
hdiutil attach Packages.dmg &&
8093
sudo installer -pkg /Volumes/Packages*/packages/packages.pkg -target / &&

CMakeLists.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
2-
cmake_policy(VERSION 3.7)
1+
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
2+
cmake_policy(VERSION 3.10.2)
33
# cmake_policy(SET CMP0046 OLD)
44
cmake_policy(SET CMP0057 NEW)
55

6-
set (REPO_VERSION 0.0.1)
6+
set (REPO_VERSION 0.2.0)
77

88
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake-modules)
99

@@ -22,10 +22,7 @@ elseif(APPLE)
2222
endif()
2323

2424
# Use FindVulkan module added with CMAKE 3.7
25-
if(NOT CMAKE_VERSION VERSION_LESS 3.7.0)
26-
message(STATUS "Using module to find Vulkan")
27-
find_package(Vulkan REQUIRED FATAL_ERROR)
28-
endif()
25+
find_package(Vulkan REQUIRED FATAL_ERROR)
2926

3027
include_directories(${Vulkan_INCLUDE_DIRS})
3128

@@ -52,8 +49,8 @@ endif(CMAKE_COMPILER_IS_GNUCXX)
5249

5350
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
5451

55-
set(CMAKE_C_STANDARD 99)
56-
set(CMAKE_CXX_STANDARD 11)
52+
set(CMAKE_C_STANDARD 11)
53+
set(CMAKE_CXX_STANDARD 14)
5754

5855
# Set the debug or relese mode.
5956
if (CMAKE_BUILD_TYPE MATCHES Debug)
@@ -221,6 +218,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
221218
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
222219

223220
add_subdirectory(external/angelia)
221+
add_subdirectory(proxy-protos)
224222
add_subdirectory(proxy-vulkan)
225223
add_subdirectory(proxy-vulkan-server)
226224
add_subdirectory(samples)

README.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [About](#about)
1111
- [What's New?](#whats-new)
1212
- [How to Build](#how-to-build)
13+
- [How to Run](#how-to-run)
1314
- [Requirements](#requirements)
1415
- [Dependencies](#dependencies)
1516
- [Future features](#future)
@@ -20,41 +21,72 @@
2021

2122
<a name="about"></a>
2223

23-
# Proxy Vulkan 0.1.0
24+
# Proxy Vulkan 0.2.0
2425

2526
Proxy Vulkan is an open source proxy library for Vulkan.
2627

27-
Version: 0.1.0 - Released: 7rd June 2020
28+
Version: 0.2.0 - Released: 25th October 2020
2829

2930
<a name="whats-new"></a>
3031

31-
## What's new in 0.1.0?
32+
## What's new in 0.1.1?
3233

33-
- Proxy vkEnumerateInstanceLayerProperties function.
34+
- Convert to C++.
35+
- Use Cap'n Proto to send the data over TCP.
3436

3537
<a name="how-to-build"></a>
3638

3739
## How to Build
3840

3941
Coming soon...
4042

43+
<a name="how-to-run"></a>
44+
45+
## How to Run (in development)
46+
47+
Currently, the IP are hard-coded.
48+
49+
To run the server:
50+
```bash
51+
./proxy-vulkan-server
52+
```
53+
54+
To run the proxy library, for example for the create instance example:
55+
- Windows:
56+
```bash
57+
./create_instance
58+
```
59+
60+
- MacOS:
61+
```bash
62+
DYLD_LIBRARY_PATH=. ./create_instance
63+
```
64+
65+
- Linux
66+
```bash
67+
LD_LIBRARY_PATH=. ./create_instance
68+
```
69+
4170
<a name="requirements"></a>
4271

4372
## Requirements
4473

45-
Coming soon...
74+
- C++14 or above compatible compiler.
4675

4776
<a name="dependencies"></a>
4877

4978
## Dependencies
5079

51-
Coming soon...
80+
- [Vulkan](https://vulkan.lunarg.com)
81+
- [Angelia](https://github.com/feserr/angelia)
82+
- [Hephaestus](https://github.com/feserr/hephaestus)
83+
- [Cap'n Proto](https://capnproto.org)
5284

5385
<a name="future"></a>
5486

5587
## Future features
5688

57-
Coming soon...
89+
- IP address are configured using a file.
5890

5991
<a name="contributing"></a>
6092

build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
workspace=`pwd`
44

55
mkdir -p build
6-
cmake -DCMAKE_BUILD_TYPE=Release -H${workspace} -B${workspace}/build -G "Ninja"
7-
cmake --build ${workspace}/build --config Release --target all -- -j 10
6+
cmake -DCMAKE_PREFIX_PATH=$HOME/capnproto -DCMAKE_BUILD_TYPE=Release -H${workspace} -B${workspace}/build -G "Ninja"
7+
cmake --build ${workspace}/build --config Release --target all -- -j 3
88
# ctest -C Release

build_osx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ workspace=`pwd`
55

66
mkdir -p build
77
cmake -DCMAKE_BUILD_TYPE=Release -H${workspace} -B${workspace}/build -G "Ninja"
8-
cmake --build ${workspace}/build --config Release --target all -- -j 10
8+
cmake --build ${workspace}/build --config Release --target all -- -j 3
99
# ctest -C Release

proxy-protos/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
2+
3+
set(NAME proxy_protos)
4+
5+
project(${NAME} VERSION ${REPO_VERSION} DESCRIPTION "Proxy Vulkan Protobuffers")
6+
7+
find_package(CapnProto CONFIG REQUIRED)
8+
9+
include_directories(${CAPNP_INCLUDE_DIRS})
10+
11+
capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS
12+
protos/result.capnp
13+
protos/function.capnp
14+
protos/instance.capnp)
15+
16+
add_library(${NAME} ${CAPNP_HDRS} ${CAPNP_SRCS})
17+
add_library(proxyvulkan::protos ALIAS ${NAME})

proxy-protos/protos/function.capnp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2020 feserr. All rights reserved.
2+
# License: https://github.com/feserr/proxy-vulkan#license
3+
4+
@0xd838357daca11376;
5+
6+
enum VkType {
7+
proxyEnd @0;
8+
proxyVkEnumerateInstanceLayerProperties @1;
9+
}
10+
11+
struct ProxyFunction {
12+
function @0 : VkType;
13+
retrieve @1 : Bool;
14+
}

0 commit comments

Comments
 (0)