Skip to content

Commit

Permalink
build: Default to VULKANSC=ON
Browse files Browse the repository at this point in the history
  • Loading branch information
aqnuep committed Apr 5, 2024
1 parent fc8b1b7 commit 72b5f09
Show file tree
Hide file tree
Showing 13 changed files with 276 additions and 235 deletions.
39 changes: 22 additions & 17 deletions .github/workflows/vvl.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2021-2023 Valve Corporation
# Copyright (c) 2021-2023 LunarG, Inc.
# Copyright (c) 2023-2024 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -26,7 +27,6 @@ on:
push:
pull_request:
branches:
- main
- sc_main

env:
Expand Down Expand Up @@ -84,25 +84,30 @@ jobs:
# https://github.com/google/sanitizers/issues/1716
- run: sudo sysctl vm.mmap_rnd_bits=28
- run: sudo apt-get -qq update && sudo apt-get install -y libwayland-dev xorg-dev
- run: python scripts/tests.py --build --config ${{ matrix.config }} --cmake='-DUSE_ROBIN_HOOD_HASHING=${{matrix.robin_hood}}'
- run: python scripts/tests_vksc.py --build --config ${{ matrix.config }} --cmake='-DUSE_ROBIN_HOOD_HASHING=${{matrix.robin_hood}}'
env:
CFLAGS: -fsanitize=${{ matrix.sanitize }}
CXXFLAGS: -fsanitize=${{ matrix.sanitize }}
LDFLAGS: -fsanitize=${{ matrix.sanitize }}
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Test Max Profile
run: python scripts/tests.py --test
run: python scripts/tests_vksc.py --test
env:
VK_KHRONOS_PROFILES_PROFILE_FILE: ${{ github.workspace }}/tests/device_profiles/max_profile.json
VKSC_DEVSIM_PROFILE_FILE: ${{ github.workspace }}/tests/vulkansc/device_profiles/max_profile.json
- name: Test Max Core
run: python scripts/tests.py --test
run: python scripts/tests_vksc.py --test
env:
VK_KHRONOS_PROFILES_PROFILE_FILE: ${{ github.workspace }}/tests/device_profiles/max_core.json
VKSC_DEVSIM_PROFILE_FILE: ${{ github.workspace }}/tests/vulkansc/device_profiles/max_core.json
- name: Test Min Core
run: python scripts/tests.py --test
run: python scripts/tests_vksc.py --test
env:
VK_KHRONOS_PROFILES_PROFILE_FILE: ${{ github.workspace }}/tests/device_profiles/min_core.json
VKSC_DEVSIM_PROFILE_FILE: ${{ github.workspace }}/tests/vulkansc/device_profiles/min_core.json
- name: Test No SPIR-V Debug Info
run: python scripts/tests_vksc.py --test
env:
VKSC_DEVSIM_PROFILE_FILE: ${{ github.workspace }}/tests/vulkansc/device_profiles/max_profile.json
VKSC_LAYER_TESTS_NO_SPV_DEBUG_INFO: TRUE

windows:
runs-on: windows-2022
Expand Down Expand Up @@ -132,9 +137,16 @@ jobs:
build-ci/external/Vulkan-Utility-Libraries/build/install
key: windows-dependencies-${{ matrix.arch }}-${{ hashfiles('scripts/known_good.json') }}
- name: Build
run: python3 scripts/tests.py --build --config debug --cmake='-DUPDATE_DEPS_SKIP_EXISTING_INSTALL=ON'
run: python3 scripts/tests_vksc.py --build --config debug --cmake='-DUPDATE_DEPS_SKIP_EXISTING_INSTALL=ON'
- name: Test Max Profile
run: python scripts/tests.py --test
run: python scripts/tests_vksc.py --test
env:
VKSC_DEVSIM_PROFILE_FILE: ${{ github.workspace }}/tests/vulkansc/device_profiles/max_profile.json
- name: Test No SPIR-V Debug Info
run: python scripts/tests_vksc.py --test
env:
VKSC_DEVSIM_PROFILE_FILE: ${{ github.workspace }}/tests/vulkansc/device_profiles/max_profile.json
VKSC_LAYER_TESTS_NO_SPV_DEBUG_INFO: TRUE

mingw:
runs-on: windows-latest
Expand Down Expand Up @@ -163,13 +175,6 @@ jobs:
- run: cmake --build build
- run: cmake --install build --prefix /tmp

chromium:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get -qq update && sudo apt-get install -y libwayland-dev xorg-dev
- run: python scripts/gn/gn.py

check_vvl:
runs-on: ubuntu-latest
steps:
Expand Down
162 changes: 0 additions & 162 deletions .github/workflows/vvl_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 @@
7. [MacOS build](#building-on-macos)
8. [Android Build](#building-for-android)
9. [Installed Files](#installed-files)
10. [Vulkan SC build](#building-vulkan-sc-validation-layers)

## Requirements

Expand All @@ -29,7 +28,7 @@ The following will be enough for most people, for more detailed instructions, se
git clone https://github.com/KhronosGroup/VulkanSC-ValidationLayers.git
cd VulkanSC-ValidationLayers

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 @@ -316,10 +315,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 Validation Layers

Commands for building the Vulkan SC version of the validation layers 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. In addition, if SCI WSI support is needed, the option `-DBUILD_WSI_SCI_SUPPORT=ON` should also be specified.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cmake_minimum_required(VERSION 3.17.2)

project(VVL LANGUAGES CXX)

option(VULKANSC "Build Vulkan SC validation layers" OFF)
option(VULKANSC "Build Vulkan SC validation layers" ON)
option(BUILD_WSI_SCREEN_QNX_SUPPORT "Build QNX screen support" OFF)
option(BUILD_WSI_SCI_SUPPORT "Build SCI WSI support" OFF)

Expand Down
4 changes: 1 addition & 3 deletions docs/generated_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ cmd /C "python3 scripts/generate_source.py external/Vulkan-Headers/registry/ ext
```

When making change to the `scripts/` folder, make sure to run `generate_source.py` and check in both the changes to
`scripts/` and `layers/vulkan/generated/` in any PR. (Code generation does **not** happen automatically at build time.)
`scripts/` and `layers/vulkansc/generated/` in any PR. (Code generation does **not** happen automatically at build time.)

> Note: All generated code is formatted with `clang-format` after it generates (see PR #6480 for details)
To generate source for Vulkan SC, the `--api vulkansc` option must be passed to the `generate_source.py` command and the generated files are located at `layers/vulkansc/generated/`.

## CMake helper

A helper CMake target `vvl_codegen` is also provided to simplify the invocation of `scripts/generate_source.py` from the build directory:
Expand Down
2 changes: 1 addition & 1 deletion layers/vulkansc/core_checks/sc_core_validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ bool SCCoreChecks::PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuff
auto cb_state = GetRead<vvl::CommandBuffer>(commandBuffer);
if (!cb_state) return false;

auto cp_state = Get<vvl::sc::CommandPool>(cb_state->command_pool->VkHandle());
auto cp_state = static_cast<const vvl::sc::CommandPool*>(cb_state->command_pool);

const Location begin_info_loc = error_obj.location.dot(Field::pBeginInfo);

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,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('registry', metavar='REGISTRY_PATH', help='path to the Vulkan-Headers registry directory')
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_spirv.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def write_inst_hash(generate_shaders, outdir=None):
def main():
parser = argparse.ArgumentParser(description='Generate spirv code for this repository, see layers/gpu_shaders/README.md for more deatils')
parser.add_argument('--api',
default='vulkan',
default='vulkansc',
choices=['vulkan', 'vulkansc'],
help='Specify API name to generate')
parser.add_argument('--shader', action='store', type=str, help='Input filename to generate a single shader')
Expand Down
16 changes: 4 additions & 12 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": "9e424e86fbbcf7768b8ecc3045fa3261c09f3fc3"
},
{
"name": "Vulkan-Utility-Libraries",
Expand All @@ -44,10 +43,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": "2acfac411465a3445e569cc2a74eba34fcffe862",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
Expand Down Expand Up @@ -155,11 +151,7 @@
"sub_dir": "Vulkan-Loader",
"build_dir": "Vulkan-Loader/build",
"install_dir": "Vulkan-Loader/build/install",
"cmake_options": [
"-DVULKANSC=ON",
"-DLOADER_USE_UNSAFE_FILE_SEARCH=ON"
],
"commit": "ef6ad6f4bc29d4006cf2a4d27ff8613c42ff545d",
"commit": "512c88a7ff0304f65520c4b17cc4839c3a4c18f2",
"build_step": "skip",
"optional": [
"tests"
Expand Down Expand Up @@ -198,7 +190,7 @@
"sub_dir": "Vulkan-Tools",
"build_dir": "Vulkan-Tools/build",
"install_dir": "Vulkan-Tools/build/install",
"commit": "3cb19d9e897ac0910e70f52a8f6368e88ca84b79",
"commit": "5f39da82c6fcc24d44ee0bb5f295898804aca903",
"build_step": "skip",
"optional": [
"tests"
Expand Down
Loading

0 comments on commit 72b5f09

Please sign in to comment.