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
19 changes: 19 additions & 0 deletions recipes-graphics/spir/spirv-headers.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SUMMARY = "Machine-readable files for the SPIR-V Registry"
DESCRIPTION = "Headers are provided in the include directory, with up-to-date \
headers in the unified1 subdirectory. Older headers are provided according to \
their version."
SECTION = "graphics"
HOMEPAGE = "https://www.khronos.org/registry/spir-v"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c938b85bceb8fb26c1a807f28a52ae2d"

SRC_URI = "git://github.com/KhronosGroup/SPIRV-Headers;protocol=https;branch=main"

PE = "1"
UPSTREAM_CHECK_GITTAGREGEX = "sdk-(?P<pver>\\d+(\\.\\d+)+)"
S = "${WORKDIR}/git"

inherit cmake

BBCLASSEXTEND = "native nativesdk"
5 changes: 5 additions & 0 deletions recipes-graphics/spir/spirv-headers_1.3.247.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require spirv-headers.inc

PV = "1.3.247"
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PV is set to 1.3.247 while the actual SPIR-V headers SDK tag is 1.3.246.1 (as noted in the comment). This creates a version number mismatch that could cause confusion. Consider whether PV should match the actual SPIR-V SDK version to maintain accurate version tracking.

Suggested change
PV = "1.3.247"
PV = "1.3.246.1"

Copilot uses AI. Check for mistakes.
# sdk-1.3.246.1 tag is the upstream drop published alongside Vulkan SDK 1.3.247
SRCREV = "1feaf4414eb2b353764d01d88f8aa4bcc67b60db"
6 changes: 6 additions & 0 deletions recipes-graphics/spir/spirv-headers_1.3.260.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require spirv-headers.inc

PV = "1.3.260"
# PV tracks the Vulkan SDK version (1.3.260); the SPIR-V headers are taken from
# the sdk-1.3.261.1 tag, which is the closest Khronos drop compatible with 1.3.260.
SRCREV = "124a9665e464ef98b8b718d572d5f329311061eb"
40 changes: 40 additions & 0 deletions recipes-graphics/spir/spirv-tools.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
SUMMARY = "The SPIR-V Tools project provides an API and commands for processing SPIR-V modules"
DESCRIPTION = "The project includes an assembler, binary module parser, disassembler, validator, and optimizer for SPIR-V."
SECTION = "graphics"
HOMEPAGE = "https://github.com/KhronosGroup/SPIRV-Tools"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRC_URI = "git://github.com/KhronosGroup/SPIRV-Tools.git;protocol=https;branch=main"

PE = "1"
UPSTREAM_CHECK_GITTAGREGEX = "sdk-(?P<pver>\\d+(\\.\\d+)+)"
S = "${WORKDIR}/git"

inherit cmake python3native

DEPENDS = "spirv-headers"

EXTRA_OECMAKE += "\
-DSPIRV-Headers_SOURCE_DIR=${STAGING_EXECPREFIXDIR} \
-DSPIRV_TOOLS_BUILD_STATIC=OFF \
-DBUILD_SHARED_LIBS=ON \
-DSPIRV_SKIP_TESTS=ON \
"

Comment on lines +20 to +25
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPIRV-Headers_SOURCE_DIR is set to ${STAGING_EXECPREFIXDIR}, which typically points at the sysroot prefix (e.g. .../sysroot/usr) rather than a SPIRV-Headers source tree. If SPIRV-Tools’ CMake expects this to contain the SPIRV-Headers repository (with its CMakeLists.txt), configure will fail. Consider vendoring SPIRV-Headers into SRC_URI (destsuffix) or switching to a find_package/install-dir based configuration if supported by this SPIRV-Tools revision.

Suggested change
-DSPIRV-Headers_SOURCE_DIR=${STAGING_EXECPREFIXDIR} \
-DSPIRV_TOOLS_BUILD_STATIC=OFF \
-DBUILD_SHARED_LIBS=ON \
-DSPIRV_SKIP_TESTS=ON \
"
-DSPIRV_TOOLS_BUILD_STATIC=OFF \
-DBUILD_SHARED_LIBS=ON \
-DSPIRV_SKIP_TESTS=ON \
"

Copilot uses AI. Check for mistakes.
do_install:append:class-target() {
# reproducibility: remove build host path
sed -i -e 's:${STAGING_DIR_HOST}${libdir}/::g' \
${D}${libdir}/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake
}
Comment on lines +26 to +30
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sed -i invocation places the target file path before -e, which GNU sed will interpret as the script/commands rather than an input file (likely causing do_install to fail). Reorder arguments so options/scripts come before the file path (e.g., sed -i -e ... <file>).

Copilot uses AI. Check for mistakes.

# all the libraries are unversioned, so don't pack it on PN-dev
SOLIBS = ".so"
FILES_SOLIBSDEV = ""

PACKAGES =+ "${PN}-lesspipe"
FILES:${PN}-lesspipe = "${base_bindir}/spirv-lesspipe.sh"
RDEPENDS:${PN}-lesspipe += "${PN} bash"

BBCLASSEXTEND = "native nativesdk"
4 changes: 4 additions & 0 deletions recipes-graphics/spir/spirv-tools_1.3.204.1.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
do_install:append:class-target() {
sed -i -e 's:${STAGING_DIR_HOST}${libdir}/::g' \
${D}${libdir}/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake
}
Comment on lines +1 to +4
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sed -i call has the file path before the -e expression; sed will treat that path as the script and likely fail. Reorder the arguments so the -e script is provided before the file name.

Copilot uses AI. Check for mistakes.
7 changes: 7 additions & 0 deletions recipes-graphics/spir/spirv-tools_1.3.247.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require spirv-tools.inc

PV = "1.3.247"
# Note: this recipe uses the SPIR-V Tools SDK drop sdk-1.3.246.1, which ships as part of
# Vulkan SDK 1.3.247. PV is intentionally set to the Vulkan SDK version (1.3.247) rather
# than the SPIR-V SDK tag to follow the Vulkan SDK versioning convention in this layer.
SRCREV = "44d72a9b36702f093dd20815561a56778b2d181e"
8 changes: 8 additions & 0 deletions recipes-graphics/spir/spirv-tools_1.3.260.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require spirv-tools.inc

PV = "1.3.260"
# Note: PV tracks the Vulkan SDK version (1.3.260), but upstream does not
# provide an exact SPIR-V Tools tag for this SDK release. We therefore pin
# SRCREV to sdk-1.3.261.1, which is the closest published SPIR-V Tools drop
# corresponding to Vulkan SDK 1.3.260.
SRCREV = "e553b884c7c9febaa4e52334f683641fb5f196a0"
55 changes: 55 additions & 0 deletions recipes-graphics/vulkan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Vulkan SDK Integration

This directory contains recipes for Vulkan SDK components used across STB and TV platforms in RDK.

## Integration Strategy

- RDK provides common, unmodified Khronos Vulkan components as external recipes:

| Component | Description |
|---------------------------|------------------------------------------------|
| `vulkan-headers` | Vulkan API headers from Khronos |
| `vulkan-loader` | Khronos Vulkan loader (`libvulkan.so`) |
| `vulkan-tools` | Vulkan info and utilities (`vulkaninfo`) |
| `vulkan-validationlayers` | Optional validation layers for debugging |

- SoC vendors are expected to:
- Provide only their Vulkan **ICD JSON** and **driver**
- Not include their own `libvulkan.so`

- All components are built via Yocto, and versioned recipes are maintained for platform-specific needs.

## OpenEmbedded-Core Integration

For version 1.3.204, this layer extends the recipes provided by the Yocto Kirkstone (OE-Core) layer:
- `vulkan-headers_1.3.204.1` - Uses OE-core recipe
- `vulkan-loader_1.3.204.1` - Uses OE-core recipe
- `vulkan-tools_1.3.204.1` - Uses OE-core recipe with custom patches via bbappend
- `spirv-headers_1.3.204.1` / `spirv-tools_1.3.204.1` - Provided by OE-core and extended as needed

The bbappend for vulkan-tools adds:
- CUBE build support (`-DBUILD_CUBE=ON`)
- Custom patches for Wayland support

## Versioning and Platform Usage

Platform-specific version selection is done via:

```conf
PREFERRED_VERSION_vulkan-headers = "1.3.260"
PREFERRED_VERSION_vulkan-loader = "1.3.260"
PREFERRED_VERSION_vulkan-tools = "1.3.260"
PREFERRED_VERSION_vulkan-validationlayers = "1.3.260"
```

These can be overridden per-platform in machine configuration files.

## Recipe Structure

- **Version 1.3.204**: Uses OE-core (Kirkstone) recipes with bbappends for customizations
- **Versions 1.3.247 and 1.3.260**: Complete recipes in this layer (not in OE-core)
- **vulkan-validationlayers**: All versions in this layer (not in OE-core)
- **SPIR-V dependencies**: For 1.3.204, `spirv-headers` and `spirv-tools` come from OE-core (Kirkstone); for newer SDKs, versions 1.3.247 and 1.3.260 are provided in this layer and follow the same versioning as the Vulkan components to keep the toolchain aligned with headers, loader, and validation layers

## Notes
- The upstream SPIR-V repositories do not ship explicit 1.3.247 / 1.3.260 tags; the recipes therefore use the closest published SDK tags (1.3.246.1 and 1.3.261.1) that ship with those Vulkan SDK drops.
25 changes: 25 additions & 0 deletions recipes-graphics/vulkan/vulkan-headers.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
SUMMARY = "Vulkan Header files and API registry"
DESCRIPTION = "Vulkan is a 3D graphics and compute API providing cross-platform access \
to modern GPUs with low overhead and targeting realtime graphics applications such as \
games and interactive media. This package contains the development headers \
for packages wanting to make use of Vulkan."
HOMEPAGE = "https://www.khronos.org/vulkan/"
BUGTRACKER = "https://github.com/KhronosGroup/Vulkan-Headers"
SECTION = "libs"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRC_URI = "git://github.com/KhronosGroup/Vulkan-Headers.git;branch=main;protocol=https"

S = "${WORKDIR}/git"

inherit cmake

FILES:${PN} = "${includedir}/vulkan ${datadir}/cmake/VulkanHeaders"

do_install:append() {
rm -rf ${D}${datadir}/vulkan
}

UPSTREAM_CHECK_GITTAGREGEX = "sdk-(?P<pver>\d+(\.\d+)+)"
6 changes: 6 additions & 0 deletions recipes-graphics/vulkan/vulkan-headers_1.3.247.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require vulkan-headers.inc

SRCREV = "95a13d7b7118d3824f0ef236bb0438d9d51f3634"
PV = "1.3.247"

PACKAGES := "${PN} ${PN}-dev"
6 changes: 6 additions & 0 deletions recipes-graphics/vulkan/vulkan-headers_1.3.260.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require vulkan-headers.inc

SRCREV = "94bb3c998b9156b9101421f7614617dfcf7f4256"
PV = "1.3.260"

PACKAGES := "${PN} ${PN}-dev"
34 changes: 34 additions & 0 deletions recipes-graphics/vulkan/vulkan-loader.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
SUMMARY = "3D graphics and compute API common loader"
DESCRIPTION = "Vulkan is a new generation graphics and compute API \
that provides efficient access to modern GPUs. These packages \
provide only the common vendor-agnostic library loader, headers and \
the vulkaninfo utility."
HOMEPAGE = "https://www.khronos.org/vulkan/"
BUGTRACKER = "https://github.com/KhronosGroup/Vulkan-Loader"
SECTION = "libs"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=7dbefed23242760aa3475ee42801c5ac"

SRC_URI = "git://github.com/KhronosGroup/Vulkan-Loader.git;branch=main;protocol=https"

S = "${WORKDIR}/git"

REQUIRED_DISTRO_FEATURES = "vulkan"
ANY_OF_DISTRO_FEATURES = "x11 wayland"

inherit cmake features_check pkgconfig

DEPENDS += "vulkan-headers"

EXTRA_OECMAKE = "\
-DBUILD_TESTS=OFF \
-DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 \
-DASSEMBLER_WORKS=FALSE \
-DVulkanHeaders_INCLUDE_DIR=${STAGING_INCDIR} \
"

PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"

PACKAGECONFIG[x11] = "-DBUILD_WSI_XLIB_SUPPORT=ON -DBUILD_WSI_XCB_SUPPORT=ON, -DBUILD_WSI_XLIB_SUPPORT=OFF -DBUILD_WSI_XCB_SUPPORT=OFF, libxcb libx11 libxrandr"
PACKAGECONFIG[wayland] = "-DBUILD_WSI_WAYLAND_SUPPORT=ON, -DBUILD_WSI_WAYLAND_SUPPORT=OFF, wayland"
4 changes: 4 additions & 0 deletions recipes-graphics/vulkan/vulkan-loader_1.3.247.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require vulkan-loader.inc

SRCREV = "797ffe01088e61daa9d12c3810e0bbaa9652558a"
PV = "1.3.247"
4 changes: 4 additions & 0 deletions recipes-graphics/vulkan/vulkan-loader_1.3.260.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require vulkan-loader.inc

SRCREV = "5bc25766b0fa8cd17d4f1f112a5c58828997cf81"
PV = "1.3.260"
50 changes: 50 additions & 0 deletions recipes-graphics/vulkan/vulkan-tools.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
SUMMARY = "Vulkan Utilities and Tools"
DESCRIPTION = "Assist development by enabling developers to verify their application's correct use of the Vulkan API."
HOMEPAGE = "https://www.khronos.org/vulkan/"
BUGTRACKER = "https://github.com/KhronosGroup/Vulkan-Tools"
SECTION = "libs"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRC_URI = "git://github.com/KhronosGroup/Vulkan-Tools.git;branch=main;protocol=https"
S = "${WORKDIR}/git"

inherit cmake features_check pkgconfig

# Wayland is required for vulkan-tools (e.g. vkcube) on RDKE
REQUIRED_DISTRO_FEATURES = "vulkan wayland"

DEPENDS += " \
vulkan-headers \
vulkan-loader \
wayland \
wayland-protocols \
wayland-native \
Comment on lines +21 to +23
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEPENDS unconditionally pulls in Wayland (and wayland-native/protocols), but the recipe advertises ANY_OF_DISTRO_FEATURES = "x11 wayland" and has PACKAGECONFIG knobs for x11/wayland. If this recipe is meant to be buildable in an x11-only distro, move Wayland dependencies into PACKAGECONFIG[wayland] (and only enable them when Wayland is selected).

Suggested change
wayland \
wayland-protocols \
wayland-native \

Copilot uses AI. Check for mistakes.
glslang-native \
"
RDEPENDS:${PN} += "vulkan-loader"

EXTRA_OECMAKE = "\
-DBUILD_TESTS=OFF \
-DBUILD_CUBE=ON \
-DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 \
-DCUBE_WSI_SELECTION=WAYLAND \
"

Comment on lines +32 to +34
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXTRA_OECMAKE forces -DCUBE_WSI_SELECTION=WAYLAND unconditionally, even when PACKAGECONFIG resolves to x11 only. This can lead to inconsistent configuration (and potential build failures) when Wayland support is disabled via PACKAGECONFIG/DISTRO_FEATURES. Consider setting CUBE_WSI_SELECTION based on PACKAGECONFIG (or default it to XCB when only x11 is enabled).

Suggested change
-DCUBE_WSI_SELECTION=WAYLAND \
"
"
EXTRA_OECMAKE:append = " ${@'-DCUBE_WSI_SELECTION=WAYLAND' if 'wayland' in d.getVar('PACKAGECONFIG').split() else '-DCUBE_WSI_SELECTION=XCB'}"

Copilot uses AI. Check for mistakes.
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"

PACKAGECONFIG[x11] = "-DBUILD_WSI_XLIB_SUPPORT=ON -DBUILD_WSI_XCB_SUPPORT=ON, -DBUILD_WSI_XLIB_SUPPORT=OFF -DBUILD_WSI_XCB_SUPPORT=OFF, libxcb libx11 libxrandr"
PACKAGECONFIG[wayland] = "-DBUILD_WSI_WAYLAND_SUPPORT=ON, -DBUILD_WSI_WAYLAND_SUPPORT=OFF, wayland wayland-protocols wayland-native"

UPSTREAM_CHECK_GITTAGREGEX = "sdk-(?P<pver>\d+(\.\d+)+)"

FILES:${PN} = " \
${bindir}/vulkaninfo \
${bindir}/vkcube \
"

do_install:append() {
rm -f ${D}${bindir}/vkcubepp || true
rm -f ${D}${bindir}/vkcube-wayland || true
}
Loading