Skip to content

Commit

Permalink
build: Downstream Vulkan-Loader 1.3.302
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasMagnus committed Dec 5, 2024
2 parents 0e1ba72 + 71f4d83 commit 9efee3d
Show file tree
Hide file tree
Showing 70 changed files with 3,615 additions and 1,127 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2021-2023 Valve Corporation
# Copyright (c) 2021-2023 LunarG, Inc.
# Copyright (c) 2021-2024 Valve Corporation
# Copyright (c) 2021-2024 LunarG, Inc.
# Copyright (c) 2023-2024 RasterGrid Kft.

# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -36,6 +36,7 @@ permissions: read-all

jobs:
linux:
needs: codegen
runs-on: ${{matrix.os}}
strategy:
matrix:
Expand Down Expand Up @@ -83,6 +84,7 @@ jobs:
- run: scripts/generate_source.py --verify ext/Vulkan-Headers/registry/

linux-no-asm:
needs: codegen
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -102,6 +104,7 @@ jobs:
- run: ctest --output-on-failure -E UnknownFunction --test-dir build/

linux-32:
needs: codegen
runs-on: ubuntu-22.04
strategy:
matrix:
Expand Down Expand Up @@ -140,6 +143,7 @@ jobs:
working-directory: build/

linux-32-no-asm:
needs: codegen
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -174,6 +178,8 @@ jobs:
working-directory: build/

windows_vs:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -193,6 +199,8 @@ jobs:
- run: ctest --output-on-failure -C ${{matrix.config}} --test-dir build/

windows_vs-no-asm:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -212,6 +220,8 @@ jobs:

# Test both clang and clang-cl (Chromium project uses clang-cl)
windows_clang:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
strategy:
matrix:
Expand All @@ -234,6 +244,8 @@ jobs:
- run: cmake --install build --prefix build/install

mingw:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
defaults:
run:
Expand All @@ -260,6 +272,8 @@ jobs:
- run: cmake --install build --prefix /tmp

mingw-use-gas:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
defaults:
run:
Expand All @@ -281,6 +295,8 @@ jobs:
- run: cmake --install build --prefix /tmp

mingw-no-asm:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
defaults:
run:
Expand All @@ -302,6 +318,8 @@ jobs:
- run: cmake --install build --prefix /tmp

mingw-no-asm-explicit:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
defaults:
run:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -68,7 +68,7 @@ jobs:
# If this step fails, then you should remove it and run the build manually
- name: Autobuild
if: matrix.language == 'python'
uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
uses: github/codeql-action/autobuild@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4

- uses: actions/setup-python@v5
if: matrix.language == 'cpp'
Expand Down Expand Up @@ -96,6 +96,6 @@ jobs:
run: cmake --build build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
with:
category: "/language:${{matrix.language}}"
51 changes: 36 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set(VULKANSC ON CACHE BOOL "User defined variable for VULKANSC mode to be passed
if(VULKANSC)
project(VULKAN_LOADER VERSION 1.0.16 LANGUAGES C)
else()
project(VULKAN_LOADER VERSION 1.3.295 LANGUAGES C)
project(VULKAN_LOADER VERSION 1.3.302 LANGUAGES C)
endif()

option(CODE_COVERAGE "Enable Code Coverage" OFF)
Expand Down Expand Up @@ -145,21 +145,25 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU")

if(BUILD_WSI_XCB_SUPPORT)
pkg_check_modules(XCB REQUIRED QUIET IMPORTED_TARGET xcb)
pkg_get_variable(XCB_INCLUDE_DIRS xcb includedir)
target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_XCB_KHR)
target_link_libraries(platform_wsi INTERFACE PkgConfig::XCB)
target_include_directories(platform_wsi INTERFACE ${XCB_INCLUDE_DIRS})
endif()
if(BUILD_WSI_XLIB_SUPPORT)
pkg_check_modules(X11 REQUIRED QUIET IMPORTED_TARGET x11)
pkg_get_variable(XLIB_INCLUDE_DIRS x11 includedir)
target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_XLIB_KHR VK_USE_PLATFORM_XLIB_XRANDR_EXT)
target_link_libraries(platform_wsi INTERFACE PkgConfig::X11)
target_include_directories(platform_wsi INTERFACE ${XLIB_INCLUDE_DIRS})
endif()
if(BUILD_WSI_WAYLAND_SUPPORT)
target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_WAYLAND_KHR)
endif()
if(BUILD_WSI_DIRECTFB_SUPPORT)
pkg_check_modules(DirectFB QUIET REQUIRED IMPORTED_TARGET directfb)
pkg_get_variable(DIRECTFB_INCLUDE_DIRS directfb includedir)
target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_DIRECTFB_EXT)
target_link_libraries(platform_wsi INTERFACE PkgConfig::DirectFB)
# vulkan_core.h includes <directfb.h> but the header is installed to directfb/directfb.h
target_include_directories(platform_wsi INTERFACE ${DIRECTFB_INCLUDE_DIRS} ${DIRECTFB_INCLUDE_DIRS}/directfb)
endif()
if(BUILD_WSI_SCI_SUPPORT)
target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_SCI)
Expand Down Expand Up @@ -200,35 +204,46 @@ option(BUILD_WERROR "Enable warnings as errors")
# Note that clang-cl.exe should use MSVC flavor flags, not GNU
if (CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC"))
if (BUILD_WERROR)
target_compile_options(loader_common_options INTERFACE /WX)
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:/WX>)
endif()
target_compile_options(loader_common_options INTERFACE /W4)
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:/W4>)
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
# using GCC or Clang with the regular front end
if (BUILD_WERROR)
target_compile_options(loader_common_options INTERFACE -Werror)
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:-Werror>)
endif()
target_compile_options(loader_common_options INTERFACE -Wall -Wextra)
target_compile_options(loader_common_options INTERFACE
$<$<COMPILE_LANGUAGE::CXX,C>:-Wall>
$<$<COMPILE_LANGUAGE::CXX,C>:-Wextra>
)
endif()

if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(loader_common_options INTERFACE -Wno-missing-field-initializers)
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:-Wno-missing-field-initializers>)

# need to prepend /clang: to compiler arguments when using clang-cl
if (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" MATCHES "MSVC")
target_compile_options(loader_common_options INTERFACE /clang:-fno-strict-aliasing)
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:/clang:-fno-strict-aliasing>)
else()
target_compile_options(loader_common_options INTERFACE -fno-strict-aliasing)
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:-fno-strict-aliasing>)
endif()

if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(loader_common_options INTERFACE -Wno-stringop-truncation -Wno-stringop-overflow)
target_compile_options(loader_common_options INTERFACE
$<$<COMPILE_LANGUAGE::CXX,C>:-Wno-stringop-truncation>
$<$<COMPILE_LANGUAGE::CXX,C>:-Wno-stringop-overflow>
)
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.1)
target_compile_options(loader_common_options INTERFACE -Wshadow=local) #only added in GCC 7
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:-Wshadow=local>) #only added in GCC 7
endif()
endif()

target_compile_options(loader_common_options INTERFACE -Wpointer-arith)
target_compile_options(loader_common_options INTERFACE $<$<COMPILE_LANGUAGE::CXX,C>:-Wpointer-arith>)

# Force GLIBC to use the 64 bit interface for file operations instead of 32 bit - More info in issue #1551
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
target_compile_definitions(loader_common_options INTERFACE _FILE_OFFSET_BITS=64)
endif()
endif()

if(CMAKE_C_COMPILER_ID MATCHES "MSVC" OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC"))
Expand All @@ -237,7 +252,13 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC" OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" A
# /guard:cf: Enable control flow guard
# /wd4152: Disable warning on conversion of a function pointer to a data pointer
# /wd4201: Disable warning on anonymous struct/unions
target_compile_options(loader_common_options INTERFACE /sdl /GR- /guard:cf /wd4152 /wd4201)
target_compile_options(loader_common_options INTERFACE
$<$<COMPILE_LANGUAGE::CXX,C>:/sdl>
$<$<COMPILE_LANGUAGE::CXX,C>:/GR->
$<$<COMPILE_LANGUAGE::CXX,C>:/guard:cf>
$<$<COMPILE_LANGUAGE::CXX,C>:/wd4152>
$<$<COMPILE_LANGUAGE::CXX,C>:/wd4201>
)

# Enable control flow guard
target_link_options(loader_common_options INTERFACE "LINKER:/guard:cf")
Expand Down
21 changes: 13 additions & 8 deletions docs/LoaderApplicationInterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,18 +472,23 @@ This can be accomplished in one of two ways:
[VkConfig](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/README.md)
tool shipped with the Vulkan SDK.
2. Directing the loader to look for layers in specific files and/or folders by using the
`VK_LAYER_PATH` environment variable.
`VK_LAYER_PATH` and/or `VK_IMPLICIT_LAYER_PATH` environment variables.

The `VK_LAYER_PATH` environment variable can contain multiple paths separated by
the operating-system specific path separator.
The `VK_LAYER_PATH` and `VK_IMPLICIT_LAYER_PATH` environment variables can contain multiple
paths separated by the operating-system specific path separator.
On Windows, this is a semicolon (`;`), while on Linux and macOS it is a colon
(`:`).

If `VK_LAYER_PATH` exists, the files and/or folders listed will be scanned for explicit
layer manifest files.
Implicit layer discovery is unaffected by this environment variable.
Each directory listed should be the full pathname of a folder containing layer
manifest files.

If `VK_IMPLICIT_LAYER_PATH` exists, the files and/or folders listed will be scanned for
implicit layer manifest files.
Explicit layer discovery is unaffected by this environment variable.

Each directory listed in `VK_LAYER_PATH` and `VK_IMPLICIT_LAYER_PATH` should be the full
pathname of a folder containing layer manifest files.

See the
[Table of Debug Environment Variables](LoaderInterfaceArchitecture.md#table-of-debug-environment-variables)
Expand All @@ -493,9 +498,9 @@ for more details.

#### Exception for Elevated Privileges

For security reasons, `VK_LAYER_PATH` is ignored if running with elevated
privileges.
Because of this, `VK_LAYER_PATH` can only be used for applications that do not
For security reasons, `VK_LAYER_PATH` and `VK_IMPLICIT_LAYER_PATH` are ignored if running
with elevated privileges.
Because of this, the environment variables can only be used for applications that do not
use elevated privileges.

For more information see
Expand Down
60 changes: 55 additions & 5 deletions docs/LoaderInterfaceArchitecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ These behaviors also result in ignoring certain environment variables, such as:
* `VK_ADD_DRIVER_FILES`
* `VK_LAYER_PATH`
* `VK_ADD_LAYER_PATH`
* `VK_IMPLICIT_LAYER_PATH`
* `VK_ADD_IMPLICIT_LAYER_PATH`
* `XDG_CONFIG_HOME` (Linux/Mac-specific)
* `XDG_DATA_HOME` (Linux/Mac-specific)

Expand Down Expand Up @@ -606,8 +608,8 @@ discovery.
</small></td>
<td><small>
Provide a list of additional paths that the loader will use to search
for layers in addition to the loader's standard Layer library search
folder when looking for explicit layer manifest files.
for explicit layers in addition to the loader's standard layer library
search paths when looking for layer manifest files.
The paths will be added first, prior to the list of folders that would
be searched normally.
</small></td>
Expand All @@ -624,6 +626,31 @@ discovery.
&nbsp;&nbsp;VK_ADD_LAYER_PATH=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;path_a&gt;;&lt;path_b&gt;</small>
</td>
</tr>
<tr>
<td><small>
<i>VK_ADD_IMPLICIT_LAYER_PATH</i>
</small></td>
<td><small>
Provide a list of additional paths that the loader will use to search
for implicit layers in addition to the loader's standard layer library
search paths when looking for layer manifest files.
The paths will be added first, prior to the list of folders that would
be searched normally.
</small></td>
<td><small>
<a href="#elevated-privilege-caveats">
Ignored when running Vulkan application with elevated privileges.
</a>
</small></td>
<td><small>
export<br/>
&nbsp;&nbsp;VK_ADD_IMPLICIT_LAYER_PATH=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;path_a&gt;:&lt;path_b&gt;<br/><br/>
set<br/>
&nbsp;&nbsp;VK_ADD_IMPLICIT_LAYER_PATH=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;path_a&gt;;&lt;path_b&gt;</small>
</td>
</tr>
<tr>
<td><small>
Expand All @@ -640,7 +667,9 @@ discovery.
continue to work.
</small></td>
<td><small>
If a relative path not used, issues may be encountered.
It is recommended to use absolute paths to JSON files.
Relative paths may have issues due to how the loader transforms relative library
paths into absolute ones.
<br/> <br/>
<a href="#elevated-privilege-caveats">
Ignored when running Vulkan application with elevated privileges.
Expand All @@ -661,8 +690,8 @@ discovery.
<td><small>
<i>VK_LAYER_PATH</i></small></td>
<td><small>
Override the loader's standard Layer library search folders and use the
provided delimited file and/or folders to locate explicit layer manifest files.
Override the loader's standard explicit layer search paths and use the
provided delimited files and/or folders to locate layer manifest files.
</small></td>
<td><small>
<a href="#elevated-privilege-caveats">
Expand All @@ -678,6 +707,27 @@ discovery.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;path_a&gt;;&lt;path_b&gt;
</small></td>
</tr>
<tr>
<td><small>
<i>VK_IMPLICIT_LAYER_PATH</i></small></td>
<td><small>
Override the loader's standard implicit layer search paths and use the
provided delimited files and/or folders to locate layer manifest files.
</small></td>
<td><small>
<a href="#elevated-privilege-caveats">
Ignored when running Vulkan application with elevated privileges.
</a>
</small></td>
<td><small>
export<br/>
&nbsp;&nbsp;VK_IMPLICIT_LAYER_PATH=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;path_a&gt;:&lt;path_b&gt;<br/><br/>
set<br/>
&nbsp;&nbsp;VK_IMPLICIT_LAYER_PATH=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;path_a&gt;;&lt;path_b&gt;
</small></td>
</tr>
<tr>
<td><small>
<i>VK_LOADER_DEBUG</i>
Expand Down
Loading

0 comments on commit 9efee3d

Please sign in to comment.