Skip to content

Commit

Permalink
[vsg] New port (VulkanSceneGraph) (#31300)
Browse files Browse the repository at this point in the history
* [vsg] New port (VulkanSceneGraph)

* [vsg] Fix deprecated function usage

* [vsg] Remove redundant linkage specification

* [vsg] Devendor glslang

* [vsg] Remove DISABLE_PARALLEL_CONFIGURE flag
  • Loading branch information
cbrl authored May 9, 2023
1 parent 4746870 commit d595260
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
68 changes: 68 additions & 0 deletions ports/vsg/devendor-glslang.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 61da709f..472bc6af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,9 +37,11 @@ find_package(Vulkan ${Vulkan_MIN_VERSION} REQUIRED)

find_package(Threads REQUIRED)

+find_package(glslang CONFIG REQUIRED)
+
# Enable/disable shader compilation support that pulls in glslang
set(VSG_SUPPORTS_ShaderCompiler 1 CACHE STRING "Optional shader compiler support, 0 for off, 1 for enabled." )
-if (VSG_SUPPORTS_ShaderCompiler)
+if (FALSE)
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/build_vars.cmake)

if (Git_FOUND)
diff --git a/src/vsg/CMakeLists.txt b/src/vsg/CMakeLists.txt
index 4154312f..49d63b97 100644
--- a/src/vsg/CMakeLists.txt
+++ b/src/vsg/CMakeLists.txt
@@ -226,7 +226,7 @@ set(SOURCES
utils/LoadPagedLOD.cpp
)

-if (${VSG_SUPPORTS_ShaderCompiler})
+if (FALSE)

# include glslang source code directly into the VulkanScenegraph library build.
include(../glslang/build_vars.cmake)
@@ -236,6 +236,14 @@ endif()
set(LIBRARIES PUBLIC
Vulkan::Vulkan
Threads::Threads
+ glslang::glslang
+ glslang::OSDependent
+ glslang::MachineIndependent
+ glslang::GenericCodeGen
+ glslang::glslang-default-resource-limits
+ glslang::OGLCompiler
+ glslang::SPVRemapper
+ glslang::SPIRV
)

# Check for std::atomic
@@ -364,9 +372,6 @@ target_include_directories(vsg
PUBLIC
$<BUILD_INTERFACE:${VSG_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${VSG_BINARY_DIR}/include>
- PRIVATE
- $<BUILD_INTERFACE:${VSG_SOURCE_DIR}/src/glslang>
- $<BUILD_INTERFACE:${GLSLANG_GENERATED_INCLUDEDIR}>
)

target_link_libraries(vsg ${LIBRARIES})
diff --git a/src/vsg/utils/ShaderCompiler.cpp b/src/vsg/utils/ShaderCompiler.cpp
index 71a7f09f..803f26a1 100644
--- a/src/vsg/utils/ShaderCompiler.cpp
+++ b/src/vsg/utils/ShaderCompiler.cpp
@@ -20,7 +20,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include <vsg/utils/ShaderCompiler.h>

#if VSG_SUPPORTS_ShaderCompiler
-# include <SPIRV/GlslangToSpv.h>
+# include <glslang/SPIRV/GlslangToSpv.h>
# include <glslang/Public/ResourceLimits.h>
# include <glslang/Public/ShaderLang.h>
#endif
17 changes: 17 additions & 0 deletions ports/vsg/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO vsg-dev/VulkanSceneGraph
REF "v${VERSION}"
SHA512 da5c9448da6bd2bd6edcb82ed1ac67aded9c3fd957fb7d3c78bb741d8993a5e90b134433237a63bf1a6eb23b30a1e6b4ea2115416f8d32464bd04925d8dbcd34
HEAD_REF master
PATCHES devendor-glslang.patch
)

vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME "vsg" CONFIG_PATH "lib/cmake/vsg")
vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
19 changes: 19 additions & 0 deletions ports/vsg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "vsg",
"version": "1.0.5",
"description": "A modern, cross platform, high performance scene graph library built upon Vulkan.",
"homepage": "http://www.vulkanscenegraph.org/",
"license": "MIT",
"dependencies": [
"glslang",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"vulkan"
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8388,6 +8388,10 @@
"baseline": "0.5.0",
"port-version": 2
},
"vsg": {
"baseline": "1.0.5",
"port-version": 0
},
"vtk": {
"baseline": "9.2.0-pv5.11.0",
"port-version": 6
Expand Down
9 changes: 9 additions & 0 deletions versions/v-/vsg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "0542d7bb873d65fa6ecbf2c3a02d7a2c7221d34a",
"version": "1.0.5",
"port-version": 0
}
]
}

0 comments on commit d595260

Please sign in to comment.