Skip to content
Open
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
55 changes: 28 additions & 27 deletions .github/workflows/tools.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.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,62 +29,56 @@ concurrency:
cancel-in-progress: true

jobs:
linux:
linux:
needs: tools_codegen
runs-on: ${{matrix.os}}

strategy:
matrix:
cc: [ gcc ]
cxx: [ g++ ]
config: [ Debug, Release ]
os: [ ubuntu-20.04, ubuntu-22.04 ]
cube_wsi: [ XCB ]
os: [ ubuntu-22.04, ubuntu-22.04 ]
include:
# Test WAYLAND
- cc: gcc
cxx: g++
config: Release
os: ubuntu-22.04
cube_wsi: WAYLAND
# Test clang on ubuntu 20 with XLIB
# Test clang on ubuntu 22
- cc: clang
cxx: clang++
config: Debug
os: ubuntu-20.04
cube_wsi: XLIB
# Test clang on ubuntu 22 with the DISPLAY option
os: ubuntu-22.04
# Test clang on ubuntu 24
- cc: clang
cxx: clang++
config: Release
os: ubuntu-22.04
cube_wsi: DISPLAY
os: ubuntu-24.04


steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.10'
- run: |
sudo apt-get -qq update
sudo apt install libwayland-dev xorg-dev wayland-protocols
sudo apt install --yes libwayland-dev xorg-dev wayland-protocols
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.17.2
cmakeVersion: 3.22.1
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.cc }}-${{matrix.cube_wsi}}
key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.cc }}
# This is to combat a bug when using 6.6 linux kernels with thread/address sanitizer
# https://github.com/google/sanitizers/issues/1716
- run: sudo sysctl vm.mmap_rnd_bits=28
- 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 \
-D BUILD_TESTS=ON \
-D ENABLE_ADDRESS_SANITIZER=OFF # Re-enable when github CI doesn't have fatal issues
-D ENABLE_ADDRESS_SANITIZER=ON
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
Expand All @@ -108,7 +102,8 @@ jobs:
- run: scripts/update_deps.py --dir ext --no-build
- run: scripts/generate_source.py --verify ext/Vulkan-Headers/registry/

windows:
windows:
needs: tools_codegen
runs-on: ${{matrix.os}}

strategy:
Expand All @@ -121,7 +116,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.10'
- uses: lukka/get-cmake@latest
- uses: ilammy/msvc-dev-cmd@v1
with:
Expand All @@ -141,6 +136,8 @@ jobs:
run: ctest --output-on-failure

mac:
# mac is 10x expensive to run on GitHub machines, so only run if we know something else fast/simple passed as well
needs: chromium
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -166,7 +163,8 @@ jobs:

- run: cmake --install build --prefix /tmp

android:
android:
needs: tools_codegen
runs-on: ubuntu-22.04
strategy:
matrix:
Expand Down Expand Up @@ -198,6 +196,7 @@ jobs:
run: cmake --install build --prefix /tmp

mingw:
needs: tools_codegen
runs-on: windows-latest
defaults:
run:
Expand Down Expand Up @@ -225,18 +224,20 @@ jobs:
- run: cmake --install build --prefix build/install

tools_codegen:
needs: codegen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: sudo apt-get -qq update && sudo apt install libwayland-dev xorg-dev wayland-protocols
- run: sudo apt-get -qq update && sudo apt install --yes libwayland-dev xorg-dev wayland-protocols
- 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:
needs: tools_codegen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Requirements

1. CMake >= 3.17.2
1. CMake >= 3.22.1
1. C++17 compatible toolchain
1. Git
1. Python >= 3.10
Expand Down Expand Up @@ -179,7 +179,7 @@ See the [CMake documentation](https://cmake.org/cmake/help/latest/generator/Xcod

## Building For Android

- CMake 3.21+
- CMake 3.22.1+
- NDK r25+
- Ninja 1.10+
- Android SDK Build-Tools 34.0.0+
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ~~~
cmake_minimum_required(VERSION 3.17.2)
cmake_minimum_required(VERSION 3.22.1)

project(Vulkan-Tools)

Expand Down Expand Up @@ -148,7 +148,6 @@ if(BUILD_ICD)
add_subdirectory(icd)
endif()

add_subdirectory(windows-runtime-installer)

if(BUILD_TESTS)
enable_testing()
Expand Down
152 changes: 152 additions & 0 deletions cube/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Copyright (C) 2025 The Fuchsia Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

assert(is_fuchsia, "This build file works on Fuchsia GN build only.")

import("//build/compiled_action.gni")
import("//build/components.gni")
import("//build_overrides/vulkan_tools.gni")
import("//src/lib/vulkan/layers.gni")

group("cube") {
testonly = true
deps = [
":vkcube-on-fb",
":vkcube-on-scenic",
]
}

fuchsia_test_component("vkcube-on-fb-component") {
component_name = "vkcube-on-fb"
deps = [
":vkcube",
"//src/lib/vulkan/swapchain:image_pipe_swapchain_fb_layer",
"//src/lib/vulkan/validation_layers",
]
manifest = "fuchsia/meta/vkcube-on-fb.cml"
test_type = "system"
}

fuchsia_test_package("vkcube-on-fb") {
test_components = [ ":vkcube-on-fb-component" ]
test_specs = {
# vkcube runs forever, so only run manually.
environments = []
}
}

fuchsia_component("vkcube-on-scenic-component") {
component_name = "vkcube-on-scenic"
deps = [
":vkcube",
"//src/lib/vulkan/swapchain:image_pipe_swapchain_layer",
"//src/lib/vulkan/validation_layers",
]

manifest = "fuchsia/meta/vkcube-on-scenic.cml"
}

fuchsia_package("vkcube-on-scenic") {
deps = [ ":vkcube-on-scenic-component" ]
}

config("cube_config") {
cube_frag_inc = "$target_gen_dir/cube.frag.inc"
cube_vert_inc = "$target_gen_dir/cube.vert.inc"

cube_frag_inc_rebased = rebase_path(cube_frag_inc, root_build_dir)
cube_vert_inc_rebased = rebase_path(cube_vert_inc, root_build_dir)

inputs = [
cube_frag_inc,
cube_vert_inc,
]

defines = [
"CUBE_FRAG_INC=\"$cube_frag_inc_rebased\"",
"CUBE_VERT_INC=\"$cube_vert_inc_rebased\"",
"VULKAN_HPP_NO_NODISCARD_WARNINGS",
]

include_dirs = [ root_build_dir ]

cflags = [ "-Wno-implicit-int-float-conversion" ]
}

executable("vkcube") {
defines = []
if (defined(texture_ppm_h)) {
path = rebase_path(texture_ppm_h, root_build_dir)
defines += [ "TEXTURE_PPM_H=\"$path\"" ]
}

sources = [
"cube.cpp",
"fuchsia/flatland_view.cpp",
"fuchsia/flatland_view.h",
]

configs += [
":cube_config",
"${volk_dir}:volk_config",
]

deps = [
":glslang_frag",
":glslang_vert",
"//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_cpp",
"//sdk/fidl/fuchsia.ui.composition:fuchsia.ui.composition_cpp",
"//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views_cpp",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/component/incoming/cpp",
"//sdk/lib/component/outgoing/cpp",
"//sdk/lib/syslog/cpp",
"//sdk/lib/ui/scenic/cpp",
"//third_party/Vulkan-Headers/src:vulkan_headers",
"//third_party/Vulkan-Loader:libvulkan",
"//zircon/system/ulib/syslog",
]
}

compiled_action("glslang_frag") {
tool = "//third_party/glslang:glslang_validator"
outputs = [ "$target_gen_dir/cube.frag.inc" ]

sources = [ "cube.frag" ]

args = [
"--quiet",
"-V",
"-x",
"-o",
rebase_path("$target_gen_dir/cube.frag.inc", root_build_dir),
rebase_path("cube.frag", root_build_dir),
]
}

compiled_action("glslang_vert") {
tool = "//third_party/glslang:glslang_validator"
outputs = [ "$target_gen_dir/cube.vert.inc" ]

sources = [ "cube.vert" ]

args = [
"--quiet",
"-V",
"-x",
"-o",
rebase_path("$target_gen_dir/cube.vert.inc", root_build_dir),
rebase_path("cube.vert", root_build_dir),
]
}
Loading