Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bonk #45

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Bonk #45

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
4 changes: 4 additions & 0 deletions .github/workflows/Windows_Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
vulkan-use-cache: true
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang

- name: Setup glslang
run: |
bash ./.github/workflows/setup-glslang.sh

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/setup-glslang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
set -e

# Variables
GLSLANG_ZIP_URL="https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip"
GLSLANG_DIR="${GITHUB_WORKSPACE}/glslang"
GLSLANG_ZIP="${GITHUB_WORKSPACE}/glslang.zip"
GLSLANG_VALIDATOR="${GLSLANG_DIR}/bin/glslangValidator.exe"

# Download glslang
echo "Downloading glslang from ${GLSLANG_ZIP_URL}..."
curl -L -o ${GLSLANG_ZIP} ${GLSLANG_ZIP_URL}

# Extract glslang
echo "Extracting glslang..."
mkdir -p ${GLSLANG_DIR}
unzip -q ${GLSLANG_ZIP} -d ${GLSLANG_DIR}

# Verify glslangValidator installation
echo "Verifying glslangValidator installation..."
if [ -f "${GLSLANG_VALIDATOR}" ]; then
echo "glslangValidator is installed successfully."
${GLSLANG_VALIDATOR} --version
else
echo "Error: glslangValidator could not be found." >&2
exit 1
fi

# Update PATH
echo "Adding glslang to PATH..."
echo "${GLSLANG_DIR}/bin" >> $GITHUB_PATH

echo "glslang setup completed successfully."
16 changes: 12 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,18 @@ if(ENABLE_OPENGL)
endif()

if(ENABLE_VULKAN)
find_package(
Vulkan 1.3.206 REQUIRED
COMPONENTS glslangValidator
)
if(NOT "glslangValidator" IN_LIST Vulkan_FIND_COMPONENTS)
list(APPEND Vulkan_FIND_COMPONENTS glslangValidator)
endif()

find_package(Vulkan REQUIRED COMPONENTS ${Vulkan_FIND_COMPONENTS})

if (NOT TARGET glslangValidator)
add_executable(glslangValidator IMPORTED)
set_target_properties(glslangValidator PROPERTIES
IMPORTED_LOCATION "${VULKAN_SDK}/bin/glslangValidator.exe"
)
endif()

set(RENDERER_VK_INCLUDE_FILES include/renderer_vk/renderer_vk.hpp
include/renderer_vk/vk_api.hpp include/renderer_vk/vk_debug.hpp
Expand Down
Loading