-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vsg] New port (VulkanSceneGraph) (#31300)
* [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
Showing
5 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} |