Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.
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
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ sample/*/textures/

vcc/include/vcc/export.h

# TODO(gardell): Generated by freeglut, should not be here.
config.h
freeglut.pc
freeglut.rc

*.spv

cpp-frp/libcpp-frp.a
Expand All @@ -19,6 +14,9 @@ test/frp-test
test-coverage.info
test-coverage/

## vscode
.vscode

## Android

*.iml
Expand Down
75 changes: 39 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,32 @@ set(CMAKE_CXX_STANDARD 11)

set(VULKAN_SDK_DIR "" CACHE PATH "Path to the Vulkan SDK")

set(VULKAN_CPP_LIBRARY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(VULKAN_CPP_LIBRARY_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

#
# SPIRV-Headers
#

set(SPIRV-Headers_SOURCE_DIR ${CMAKE_BINARY_DIR}/spirv-headers-src)
set(SPIRV-Headers_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/spirv-headers-src)

# Download and unpack SPIRV-Headers at configure time
configure_file(CMakeLists.txt.spirv-headers.in
spirv-headers-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/spirv-headers-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/spirv-headers-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/spirv-headers-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/spirv-headers-download)

# Add SPIRV-Headers directly to our build.
add_subdirectory(${CMAKE_BINARY_DIR}/spirv-headers-src
${CMAKE_BINARY_DIR}/spirv-headers-build)
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/spirv-headers-src
${CMAKE_CURRENT_BINARY_DIR}/spirv-headers-build)

#
# SPIRV-Tools
#

set(SPIRV_TOOLS_SRC ${CMAKE_BINARY_DIR}/spirv-tools-src)
set(SPIRV_TOOLS_SRC ${CMAKE_CURRENT_BINARY_DIR}/spirv-tools-src)

SET(SPIRV_SKIP_EXECUTABLES OFF CACHE BOOL "" FORCE)
SET(SPIRV_SKIP_TESTS OFF CACHE BOOL "" FORCE)
Expand All @@ -46,43 +49,43 @@ SET(SPIRV_SKIP_TESTS OFF CACHE BOOL "" FORCE)
configure_file(CMakeLists.txt.spirv-tools.in
spirv-tools-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/spirv-tools-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/spirv-tools-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/spirv-tools-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/spirv-tools-download)

# Add SPIRV-Tools directly to our build.
add_subdirectory(${CMAKE_BINARY_DIR}/spirv-tools-src
${CMAKE_BINARY_DIR}/spirv-tools-build)
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/spirv-tools-src
${CMAKE_CURRENT_BINARY_DIR}/spirv-tools-build)

#
# glm
#

add_definitions(-DGLM_ENABLE_EXPERIMENTAL)

set(GLM_SRC_DIR ${CMAKE_BINARY_DIR}/glm-src)
set(GLM_SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}/glm-src)

# Download and unpack glm at configure time
configure_file(CMakeLists.txt.glm.in
glm-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glm-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glm-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glm-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glm-download)

#
# gli
#

set(GLI_SRC_DIR ${CMAKE_BINARY_DIR}/gli-src)
set(GLI_SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}/gli-src)

# Download and unpack gli at configure time
configure_file(CMakeLists.txt.gli.in
gli-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gli-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gli-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/gli-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gli-download)

if(NOT DEFINED ANDROID_NDK)

Expand All @@ -94,9 +97,9 @@ if(NOT DEFINED ANDROID_NDK)
configure_file(CMakeLists.txt.googletest.in
googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download)

# Prevent GoogleTest from overriding our compiler/linker options
# when building with Visual Studio
Expand All @@ -105,8 +108,8 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# Add googletest directly to our build. This adds
# the following targets: gtest, gtest_main, gmock
# and gmock_main
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
${CMAKE_BINARY_DIR}/googletest-build)
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
${CMAKE_CURRENT_BINARY_DIR}/googletest-build)

#
# Glslang
Expand All @@ -116,66 +119,66 @@ add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
configure_file(CMakeLists.txt.glslang.in
glslang-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glslang-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glslang-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glslang-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glslang-download)

# Add glslang directly to our build.
add_subdirectory(${CMAKE_BINARY_DIR}/glslang-src
${CMAKE_BINARY_DIR}/glslang-build)
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/glslang-src
${CMAKE_CURRENT_BINARY_DIR}/glslang-build)


#
# OpenVR
#

set(OPENVR_SOURCE_DIR ${CMAKE_BINARY_DIR}/openvr)
set(OPENVR_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/openvr)

# Download and unpack OpenVR at configure time
configure_file(CMakeLists.txt.openvr.in
openvr-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/openvr-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openvr-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/openvr-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openvr-download)

#
# zlib
#

set(SKIP_INSTALL_ALL true)
set(ZLIB_SRC_DIR ${CMAKE_BINARY_DIR}/zlib-src)
set(ZLIB_SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}/zlib-src)

# Download and unpack zlib at configure time
configure_file(CMakeLists.txt.zlib.in
zlib-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/zlib-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zlib-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/zlib-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zlib-download)

# Add zlib directly to our build.
add_subdirectory(${ZLIB_SRC_DIR}
${CMAKE_BINARY_DIR}/zlib-build)
${CMAKE_CURRENT_BINARY_DIR}/zlib-build)

set(ZLIB_LIBRARY zlib)
set(ZLIB_INCLUDE_DIR ${ZLIB_SRC_DIR} ${CMAKE_BINARY_DIR}/zlib-build)
set(ZLIB_INCLUDE_DIR ${ZLIB_SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}/zlib-build)

#
# png
#

set(PNG_SRC_DIR ${CMAKE_BINARY_DIR}/png-src)
set(PNG_BUILD_DIR ${CMAKE_BINARY_DIR}/png-build)
set(PNG_SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}/png-src)
set(PNG_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/png-build)
set(PNG_INCLUDE_DIR ${PNG_SRC_DIR} ${PNG_BUILD_DIR})

# Download and unpack png at configure time
configure_file(CMakeLists.txt.png.in
png-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/png-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/png-download)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/png-download)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/png-download)

# Add png directly to our build.
add_subdirectory(${PNG_SRC_DIR} ${PNG_BUILD_DIR})
Expand Down
27 changes: 0 additions & 27 deletions CMakeLists.txt.freeglut.in

This file was deleted.

4 changes: 2 additions & 2 deletions CMakeLists.txt.glslang.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ include(ExternalProject)
ExternalProject_Add(glslang
GIT_REPOSITORY https://github.com/KhronosGroup/glslang.git
GIT_TAG master
SOURCE_DIR "${CMAKE_BINARY_DIR}/glslang-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/glslang-build"
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/glslang-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/glslang-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt.googletest.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt.spirv-headers.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ExternalProject_Add(spirv-headers
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Headers.git
GIT_TAG master
SOURCE_DIR "${SPIRV-Headers_SOURCE_DIR}"
BINARY_DIR "${CMAKE_BINARY_DIR}/spirv-headers-build"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/spirv-headers-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt.spirv-tools.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ExternalProject_Add(spirv-tools
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Tools.git
GIT_TAG master
SOURCE_DIR "${SPIRV_TOOLS_SRC}"
BINARY_DIR "${CMAKE_BINARY_DIR}/spirv-tools-build"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/spirv-tools-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt.zlib.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ExternalProject_Add(zlib
GIT_REPOSITORY https://github.com/madler/zlib.git
GIT_TAG master
SOURCE_DIR "${ZLIB_SRC_DIR}"
BINARY_DIR "${CMAKE_BINARY_DIR}/zlib-build"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/zlib-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ The library is thread-safe as required by the Vulkan specification, `2.5 Threadi
Notice that `Implicit Externally Synchronized Parameters` is not included.
### OpenVR
Samples include an OpenVR example. This simple demo renders the models of the connected devices like trackers and controllers. It supports lazy loading and recompiles the command buffers when any new devices are added or removed.
##Install
###Linux/XCB
## Install
### Linux/XCB
`cmake .` downloads all the dependencies needed. `cmake --build .` compiles the libraries and samples.
###Android
### Android
Install `Android Studio` and the `NDK`. `SDK 25` is required. Import the root project directory. Initial building and synchronizing will take a very long time, as it will download the dependency projects needed.

**Note:** Textures are copied to the `assets/` and `res/` folders of the respective projects. However, `*.spv` compiled shaders are not generated. These must be copied to the `assets/` folder.
###Visual Studio 2015
### Visual Studio 2015
Only 2015 is supported. The C++11 support in previous versions is not sufficient.
`cmake -DVULKAN_SDK_DIR:PATH=<path-to-vulkan-sdk> .` downloads all the dependencies and sets up the projects.
Either use `cmake --build .` to compile or open the generated `.sln`.
Expand Down
2 changes: 1 addition & 1 deletion sample/cube/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

include_directories(../../types/include)
include_directories(../../vcc/include)
include_directories(${CMAKE_BINARY_DIR}/vcc/include)
include_directories(${VULKAN_CPP_LIBRARY_BINARY_DIR}/vcc/include)
include_directories(../../vcc-image/include)
include_directories(${GLM_SRC_DIR})
if(NOT VULKAN_SDK_DIR STREQUAL "")
Expand Down
2 changes: 1 addition & 1 deletion sample/heightmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

include_directories(../../types/include)
include_directories(../../vcc/include)
include_directories(${CMAKE_BINARY_DIR}/vcc/include)
include_directories(${VULKAN_CPP_LIBRARY_BINARY_DIR}/vcc/include)
include_directories(../../vcc-image/include)
include_directories(${CPP_FRP_SRC_DIR}/cpp-frp/include)
include_directories(${GLM_SRC_DIR})
Expand Down
2 changes: 1 addition & 1 deletion sample/lighting/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
include_directories(include)
include_directories(../../types/include)
include_directories(../../vcc/include)
include_directories(${CMAKE_BINARY_DIR}/vcc/include)
include_directories(${VULKAN_CPP_LIBRARY_BINARY_DIR}/vcc/include)
include_directories(${GLM_SRC_DIR})
if(NOT VULKAN_SDK_DIR STREQUAL "")
include_directories(${VULKAN_SDK_DIR}/include)
Expand Down
2 changes: 1 addition & 1 deletion sample/normal-mapping-and-cube-texture/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

include_directories(../../types/include)
include_directories(../../vcc/include)
include_directories(${CMAKE_BINARY_DIR}/vcc/include)
include_directories(${VULKAN_CPP_LIBRARY_BINARY_DIR}/vcc/include)
include_directories(../../vcc-image/include)
include_directories(${GLM_SRC_DIR})
if(NOT VULKAN_SDK_DIR STREQUAL "")
Expand Down
2 changes: 1 addition & 1 deletion sample/openvr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
include_directories(include)
include_directories(../../types/include)
include_directories(../../vcc/include)
include_directories(${CMAKE_BINARY_DIR}/vcc/include)
include_directories(${VULKAN_CPP_LIBRARY_BINARY_DIR}/vcc/include)
include_directories(../../vcc-image/include)
include_directories(${GLM_SRC_DIR})
include_directories(${OPENVR_SOURCE_DIR}/headers)
Expand Down
2 changes: 1 addition & 1 deletion sample/teapot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
include_directories(include)
include_directories(../../types/include)
include_directories(../../vcc/include)
include_directories(${CMAKE_BINARY_DIR}/vcc/include)
include_directories(${VULKAN_CPP_LIBRARY_BINARY_DIR}/vcc/include)
include_directories(../../vcc-image/include)
include_directories(${GLM_SRC_DIR})
if(NOT VULKAN_SDK_DIR STREQUAL "")
Expand Down
2 changes: 1 addition & 1 deletion vcc-image/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
include_directories(include)
include_directories(../types/include)
include_directories(../vcc/include)
include_directories(${CMAKE_BINARY_DIR}/vcc/include)
include_directories(${VULKAN_CPP_LIBRARY_BINARY_DIR}/vcc/include)
include_directories(${GLI_SRC_DIR})
include_directories(${GLI_SRC_DIR}/external)
if(NOT PNG_INCLUDE_DIR STREQUAL "")
Expand Down
2 changes: 1 addition & 1 deletion vcc-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#

include_directories(../vcc/include)
include_directories(${CMAKE_BINARY_DIR}/vcc/include)
include_directories(${VULKAN_CPP_LIBRARY_BINARY_DIR}/vcc/include)
include_directories(../types/include)
include_directories(${gtest_SOURCE_DIR}/include)
include_directories(${GLM_SRC_DIR})
Expand Down
Loading