You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Enable/disable shader compilation support that pulls in glslang
44
44
set(VSG_SUPPORTS_ShaderCompiler 1 CACHESTRING"Optional shader compiler support, 0 for off, 1 for enabled." )
45
45
if (VSG_SUPPORTS_ShaderCompiler)
46
-
if (NOTEXISTS${CMAKE_CURRENT_SOURCE_DIR}/src/glslang/build_vars.cmake)
47
46
48
-
if (Git_FOUND)
47
+
# Try looking for glslang 15 first.
48
+
set(GLSLANG_MIN_VERSION "15"CACHESTRING"glslang 14 is the earliest version that we think installs itself properly on all platforms. Other platforms may be able to use an earlier version")
message(WARNING "glslang not found. ShaderCompile support disabled.")
61
+
set(VSG_SUPPORTS_ShaderCompiler 0)
62
+
set(FIND_DEPENDENCY_glslang "")
65
63
endif()
64
+
else()
65
+
set(FIND_DEPENDENCY_glslang "")
66
66
endif()
67
67
68
68
set(VSG_SUPPORTS_Windowing 1 CACHESTRING"Optional native windowing support providing a default implementation of vsg::Window::create(), 0 for off, 1 for enabled." )
VulkanSceneGraph build requires C++ 17, CMake and vulkan as a required dependency, and has an optional dependency of glslang 14.0 or later which is used for applications that required runtime shader compilation. Latest Linux releases, such as Ubuntu 24.04, have a modern enough version of glslang out of the box so the following instructions will work out of the box, but wiht older distributions the glslang version will predate 14 and is not supported by the VulkanSceneGraph, so if you require runtime shader compilation you will need to either use the version provided by a recent [VulkanSDK](https://vulkan.lunarg.com/) distribution or compile and install [glslang](https://github.com/KhronosGroup/glslang) from source.
After running cmake open the generated VSG.xcodeproj file and build the All target. Once built you can run the install target. Please note that for release builds you currently need to use the Archive option in xcode. This will rebuild every time so you can just select the install target and run Archive which will also build the All target.
114
+
cmake .
115
+
cmake --build . -j 8
100
116
101
117
---
102
118
@@ -207,7 +223,7 @@ For example, a bare minimum CMakeLists.txt file adding the mentioned cmake targe
207
223
208
224
### Using VSG provided cmake macro to generate cmake support files
209
225
210
-
Projects that install a library must generate some cmake-related files so that the library can be found by ```find_package()```. To simplify the generation of these files, the cmake macro ```vsg_add_cmake_support_files()``` has been added.
226
+
Projects that install a library must generate some cmake-related files so that the library can be found by ```find_package()```. To simplify the generation of these files, the cmake macro ```vsg_add_cmake_support_files()``` has been added.
211
227
212
228
In addition to calling the macro, it requires a template for creating the xxxConfig.cmake file, as given in the following example:
213
229
@@ -323,7 +339,7 @@ So now we're ready to build VSG. With the SDK installed this is very similar to
Once CMake has finished you can open the generated Xcode project and build the 'install' target. This will build VSG and install the headers and generated library onto your machine.
328
344
329
345
Again, as with other platforms it's useful to now set your CMAKE_PREFIX_PATH to point to the VSG library we have just installed. If you've installed to the default location you can add the following to your .bash_profile file.
Copy file name to clipboardExpand all lines: README.md
+6-15Lines changed: 6 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,22 +38,14 @@ Community projects:
38
38
## Quick Guide to building the VSG
39
39
40
40
### Prerequisites:
41
-
* C++17 compliant compiler i.e. g++ 7.3 or later, Clang 6.0 or later, Visual Studio S2017 or later.
42
-
*[Vulkan](https://vulkan.lunarg.com/) 1.1 or later.
43
-
*[CMake](https://www.cmake.org) 3.7 or later.
41
+
* Required: C++17 compliant compiler i.e. g++ 7.3 or later, Clang 6.0 or later, Visual Studio S2017 or later.
42
+
* Required: [CMake](https://www.cmake.org) 3.7 or later.
43
+
* Required: [Vulkan](https://vulkan.lunarg.com/) 1.1 or later.
44
+
* Optional : [glslang](https://github.com/KhronosGroup/glslang) 14.0 or later. Only required if shader compilation at runtime is needed.
44
45
45
46
The above dependency versions are known to work so they've been set as the current minimum, it may be possible to build against older versions. If you find success with older versions let us know and we can update the version info.
46
47
47
-
Download VulkanSDK from [LunarG](https://vulkan.lunarg.com/sdk/home), unpack into local directory and set VULKAN_SDK environment variable to the include/lib directory within it. For Linux it would typically be along the lines of:
tar zxf VulkanSDK/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.gz -C VulkanSDK/
55
-
56
-
Once you've downloaded and unpacked the VulkanSDK you'll want to put VULKAN_SDK into your user environment variable setup so that CMake's find_package(Vulkan) can find the VulkanSDK's location.
48
+
While you can install Vulkan and glslang development libraries and headers from 3rd party repositoriesm these may be older, so for the latest versions you can also use the VulkanSDK provided by LunarG. Your can download VulkanSDK from [LunarG](https://vulkan.lunarg.com/sdk/home), unpack into a local directory and set VULKAN_SDK environment variable to the include/lib directory within it.
57
49
58
50
### Command line build instructions:
59
51
@@ -62,7 +54,6 @@ To build and install the static libvsg library (.a/.lib) in source:
0 commit comments