From 6a1fd380633a52ea171e28e7bbbe73f4ae4d8b79 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Sun, 13 Aug 2023 15:45:22 -0700 Subject: [PATCH] build: Use new glslang tool name. (#6889) --- .github/workflows/ci.yml | 21 +++++++++++---------- src/video_core/host_shaders/CMakeLists.txt | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdd05d4b0..4e418689d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,9 +161,16 @@ jobs: - name: Set up MSVC uses: ilammy/msvc-dev-cmd@v1 if: ${{ matrix.target == 'msvc' }} - - name: Install MSVC extra tools + - name: Install extra tools (MSVC) run: choco install ccache ninja wget if: ${{ matrix.target == 'msvc' }} + - name: Set up Vulkan SDK (MSVC) + uses: humbletim/setup-vulkan-sdk@v1.2.0 + if: ${{ matrix.target == 'msvc' }} + with: + vulkan-query-version: latest + vulkan-components: Glslang + vulkan-use-cache: true - name: Set up MSYS2 uses: msys2/setup-msys2@v2 if: ${{ matrix.target == 'msys2' }} @@ -172,16 +179,10 @@ jobs: update: true install: git make p7zip pacboy: >- - toolchain:p ccache:p cmake:p ninja:p + toolchain:p ccache:p cmake:p ninja:p glslang:p qt6-base:p qt6-multimedia:p qt6-multimedia-wmf:p qt6-tools:p qt6-translations:p - - name: Setup Vulkan SDK - uses: humbletim/setup-vulkan-sdk@v1.2.0 - with: - vulkan-query-version: latest - vulkan-components: Glslang - vulkan-use-cache: true - - name: Test glslangValidator - run: glslangValidator --version + - name: Test glslang + run: glslang --version || glslangValidator --version - name: Disable line ending translation run: git config --global core.autocrlf input - name: Build diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt index 1c054978f..8acc71c03 100644 --- a/src/video_core/host_shaders/CMakeLists.txt +++ b/src/video_core/host_shaders/CMakeLists.txt @@ -27,9 +27,12 @@ set(SHADER_FILES vulkan_blit_depth_stencil.frag ) -find_program(GLSLANGVALIDATOR "glslangValidator") -if ("${GLSLANGVALIDATOR}" STREQUAL "GLSLANGVALIDATOR-NOTFOUND") - message(FATAL_ERROR "Required program `glslangValidator` not found.") +find_program(GLSLANG "glslang") +if ("${GLSLANG}" STREQUAL "GLSLANG-NOTFOUND") + find_program(GLSLANG "glslangValidator") + if ("${GLSLANG}" STREQUAL "GLSLANG-NOTFOUND") + message(FATAL_ERROR "Required program `glslang` (or `glslangValidator`) not found.") + endif() endif() set(MACROS "-Dgl_VertexID=gl_VertexIndex") @@ -42,11 +45,11 @@ set(HOST_SHADERS_INCLUDE ${SHADER_INCLUDE} PARENT_SCOPE) set(INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/source_shader.h.in) set(HEADER_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/StringShaderHeader.cmake) -# Check if `--quiet` is available on host's glslangValidator version -# glslangValidator prints to STDERR iff an unrecognized flag is passed to it +# Check if `--quiet` is available on host's glslang version +# glslang prints to STDERR iff an unrecognized flag is passed to it execute_process( COMMAND - ${GLSLANGVALIDATOR} ${QUIET_FLAG} + ${GLSLANG} ${QUIET_FLAG} ERROR_VARIABLE GLSLANG_ERROR # STDOUT variable defined to silence unnecessary output during CMake configuration @@ -55,7 +58,7 @@ execute_process( ) if (NOT GLSLANG_ERROR STREQUAL "") - message(WARNING "Refusing to use unavailable flag `${QUIET_FLAG}` on `${GLSLANGVALIDATOR}`") + message(WARNING "Refusing to use unavailable flag `${QUIET_FLAG}` on `${GLSLANG}`") set(QUIET_FLAG "") endif() @@ -87,7 +90,7 @@ foreach(FILENAME IN ITEMS ${SHADER_FILES}) OUTPUT ${SPIRV_HEADER_FILE} COMMAND - ${GLSLANGVALIDATOR} --target-env vulkan1.1 --glsl-version 450 ${QUIET_FLAG} ${MACROS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE} + ${GLSLANG} --target-env vulkan1.1 --glsl-version 450 ${QUIET_FLAG} ${MACROS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE} MAIN_DEPENDENCY ${SOURCE_FILE} )