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

build: Default to VULKANSC=ON #12

Merged
merged 1 commit into from
Apr 8, 2024
Merged
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
62 changes: 1 addition & 61 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ on:
push:
pull_request:
branches:
- main
- sc_main

# https://docs.github.com/en/actions/using-jobs/using-concurrency
Expand All @@ -39,27 +38,6 @@ jobs:
cxx: [ g++ ]
config: [ Debug, Release ]
os: [ ubuntu-20.04, ubuntu-22.04 ]
cube_wsi: [ XCB ]
include:
# Test WAYLAND
- cc: gcc
cxx: g++
config: Release
os: ubuntu-22.04
cube_wsi: WAYLAND
# Test clang on ubuntu 20 with XLIB
- cc: clang
cxx: clang++
config: Debug
os: ubuntu-20.04
cube_wsi: XLIB
# Test clang on ubuntu 22 with the DISPLAY option
- cc: clang
cxx: clang++
config: Release
os: ubuntu-22.04
cube_wsi: DISPLAY


steps:
- uses: actions/checkout@v4
Expand All @@ -75,12 +53,11 @@ jobs:
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.cc }}-${{matrix.cube_wsi}}
key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.cc }}
- name: Configure
run: |
cmake -S. -B build -G "Ninja" \
-D CMAKE_BUILD_TYPE=${{matrix.config}} \
-D CUBE_WSI_SELECTION=${{matrix.cube_wsi}} \
-D UPDATE_DEPS=ON \
-D BUILD_WERROR=ON \
-D INSTALL_ICD=ON \
Expand Down Expand Up @@ -141,37 +118,6 @@ jobs:
working-directory: ./build
run: ctest --output-on-failure

android:
runs-on: ubuntu-22.04
strategy:
matrix:
abi: [ armeabi-v7a, arm64-v8a ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: lukka/get-cmake@latest
- name: Configure
run: |
cmake -S . -B build/ --toolchain $ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-D ANDROID_PLATFORM=23 \
-D CMAKE_ANDROID_ARCH_ABI=${{matrix.abi}} \
-D CMAKE_ANDROID_STL_TYPE=c++_static \
-D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=NO \
-D CMAKE_BUILD_TYPE=Release \
-D UPDATE_DEPS=ON \
-D BUILD_TESTS=ON \
-D BUILD_WERROR=ON \
-G "Ninja"
- name: Build
run: cmake --build build
- name: Test
working-directory: ./build
run: ctest --output-on-failure -C Release
- name: Install
run: cmake --install build --prefix /tmp

mingw:
runs-on: windows-latest
defaults:
Expand Down Expand Up @@ -210,9 +156,3 @@ jobs:
- run: cmake -S . -B build/ -D UPDATE_DEPS=ON -D UPDATE_DEPS_DIR=external -D TOOLS_CODEGEN=ON
- run: cmake --build build --target tools_codegen
- run: git diff --exit-code

chromium:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: scripts/gn/gn.py
156 changes: 0 additions & 156 deletions .github/workflows/tools_sc.yml

This file was deleted.

10 changes: 1 addition & 9 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
1. [MacOS build](#building-on-macos)
1. [Android Build](#building-for-android)
1. [Installed Files](#installed-files)
1. [Vulkan SC Build](#building-vulkan-sc-tools)

## Requirements

Expand Down Expand Up @@ -40,7 +39,7 @@ The following will be enough for most people, for more detailed instructions, se
git clone https://github.com/KhronosGroup/VulkanSC-Tools.git
cd VulkanSC-Tools

cmake -S . -B build -D UPDATE_DEPS=ON -D BUILD_WERROR=ON -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug -D VULKANSC=ON
cmake -S . -B build -D UPDATE_DEPS=ON -D BUILD_WERROR=ON -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
```

Expand Down Expand Up @@ -326,10 +325,3 @@ CMake Docs:
# NOTE: --config is only needed for multi-config generators (Visual Studio, Xcode, etc)
cmake --install build/ --config Release --prefix build/install
```

### Building Vulkan SC Tools

Commands for building the Vulkan SC version of the tools are similar to the instructions in the sections above with a few minor differences:

1) When running `update_deps.py` and/or `generate_source.py`, the option `--api vulkansc` should be specified.
2) When running `cmake -C helper.cmake ...`, the option `-DVULKANSC=ON` should be passed in.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ cmake_minimum_required(VERSION 3.17.2)

project(Vulkan-Tools)

option(VULKANSC "Build Vulkan SC tools" ON)

# This variable enables downstream users to customize the target API
# variant (e.g. Vulkan SC)
set(API_TYPE "vulkan")
Expand All @@ -41,8 +43,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

option(VULKANSC "Build Vulkan SC tools" OFF)
option(BUILD_VKSC_DEVSIM "Build Vulkan SC device simulation layer" OFF)
option(BUILD_VKSC_DEVSIM "Build Vulkan SC device simulation layer" ON)

option(BUILD_CUBE "Build cube" ON)
option(BUILD_VULKANINFO "Build vulkaninfo" ON)
Expand Down
2 changes: 1 addition & 1 deletion devsim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This directory contains the Vulkan SC Device Simulation Layer (`VK_LAYER_KHRONOS

## Building the Vulkan SC Device Simulation Layer

In order to build the Vulkan SC Device Simulation Layer, enable the `BUILD_VKSC_DEVSIM` build option when building the VulkanSC-Tools.
The Vulkan SC Device Simulation Layer is built when the `BUILD_VKSC_DEVSIM` build option is enabled (default for Vulkan SC builds) when building the VulkanSC-Tools.

## Using the Vulkan SC Device Simulation Layer

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
def main(argv):
parser = argparse.ArgumentParser(description='Generate source code for this repository')
parser.add_argument('--api',
default='vulkan',
default='vulkansc',
choices=['vulkan', 'vulkansc'],
help='Specify API name to generate')
parser.add_argument('--generated-version', help='sets the header version used to generate the repo')
Expand Down
11 changes: 3 additions & 8 deletions scripts/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"build_dir": "Vulkan-Headers/build",
"install_dir": "Vulkan-Headers/build/install",
"cmake_options": [
"-DVULKANSC=ON",
"-DGEN_VULKANSC_COMBINED=ON"
],
"commit": "be40e89611cbbd4a48e4a566ddac468da5eb1cef"
"commit": "fb874b731b9097af396411c0d19362419f798200"
},
{
"name": "Vulkan-Utility-Libraries",
Expand All @@ -29,10 +28,7 @@
"sub_dir": "Vulkan-Utility-Libraries",
"build_dir": "Vulkan-Utility-Libraries/build",
"install_dir": "Vulkan-Utility-Libraries/build/install",
"commit": "c0342cb387180f8bcbb0a38551603c365434581f",
"cmake_options": [
"-DVULKANSC=ON"
],
"commit": "7dc142c45f5a37e2b0e60c202863579b33443052",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
Expand Down Expand Up @@ -151,10 +147,9 @@
"build_dir": "Vulkan-Loader/build",
"install_dir": "Vulkan-Loader/build/install",
"cmake_options": [
"-DVULKANSC=ON",
"-DLOADER_USE_UNSAFE_FILE_SEARCH=ON"
],
"commit": "ef6ad6f4bc29d4006cf2a4d27ff8613c42ff545d",
"commit": "86492711fec3dcc37fc38b14fbad2bcff3042ad6",
"build_platforms": [
"windows",
"linux",
Expand Down
2 changes: 1 addition & 1 deletion scripts/kvt_genvk.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def genTarget(args):
parser = argparse.ArgumentParser()

parser.add_argument('-api', action='store',
default='vulkan',
default='vulkansc',
choices=['vulkan', 'vulkansc'],
help='Specify API name to generate')
parser.add_argument('-defaultExtensions', action='store',
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def main():
parser.add_argument(
'--api',
dest='api',
default='vulkan',
default='vulkansc',
choices=['vulkan', 'vulkansc'],
help="Target API")
parser.add_argument(
Expand Down