diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-02 22:47:51 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-02 22:47:51 +0900 |
| commit | 1fa458c0bec7e686d16a08ad398d6b2598be5385 (patch) | |
| tree | e0bf9396bc568a2ebbfcf181a873503033479df7 /internal | |
| parent | 2c7ae67a67c9504f667f5463895aef2f3140a39d (diff) | |
internal/rosa/glslang: SPIRV-LLVM-Translator artifact
Required by mesa.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/rosa/all.go | 1 | ||||
| -rw-r--r-- | internal/rosa/glslang.go | 62 |
2 files changed, 63 insertions, 0 deletions
diff --git a/internal/rosa/all.go b/internal/rosa/all.go index ec4241f2..ba90a2c6 100644 --- a/internal/rosa/all.go +++ b/internal/rosa/all.go @@ -149,6 +149,7 @@ const ( Rsync Sed SPIRVHeaders + SPIRVLLVMTranslator SPIRVTools SquashfsTools Strace diff --git a/internal/rosa/glslang.go b/internal/rosa/glslang.go index 663e0610..702cebc0 100644 --- a/internal/rosa/glslang.go +++ b/internal/rosa/glslang.go @@ -126,3 +126,65 @@ func init() { ID: 205796, } } + +func (t Toolchain) newSPIRVLLVMTranslator() (pkg.Artifact, string) { + const ( + version = "22.1.2" + checksum = "JZAaV5ewYcm-35YA_U2BM2IcsQouZtX1BLZR0zh2vSlfEXMsT5OCtY4Gh5RJkcGy" + ) + return t.NewPackage("spirv-llvm-translator", version, newFromGitHub( + "KhronosGroup/SPIRV-LLVM-Translator", + "v"+version, checksum, + ), &PackageAttr{ + Patches: []KV{ + {"remove-early-prefix", `diff --git a/CMakeLists.txt b/CMakeLists.txt +index c000a77e..86f79b03 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -172,5 +172,5 @@ install( + FILES + ${CMAKE_BINARY_DIR}/LLVMSPIRVLib.pc + DESTINATION +- ${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/pkgconfig ++ lib${LLVM_LIBDIR_SUFFIX}/pkgconfig + ) +`}, + }, + + // litArgs emits shell syntax + ScriptEarly: ` +export LIT_OPTS=` + litArgs(true, + // error: line 13: OpTypeCooperativeMatrixKHR Scope is limited to Workgroup and Subgroup + "cooperative_matrix_constant_null.spvasm") + ` +`, + }, &CMakeHelper{ + Cache: []KV{ + {"CMAKE_SKIP_BUILD_RPATH", "ON"}, + {"BUILD_SHARED_LIBS", "ON"}, + {"LLVM_SPIRV_ENABLE_LIBSPIRV_DIS", "ON"}, + {"LLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR", "/system"}, + {"LLVM_EXTERNAL_LIT", "/system/bin/lit"}, + {"LLVM_INCLUDE_TESTS", "ON"}, + }, + }, + Bash, + LIT, + + SPIRVTools, + ), version +} +func init() { + artifactsM[SPIRVLLVMTranslator] = Metadata{ + f: Toolchain.newSPIRVLLVMTranslator, + + Name: "spirv-llvm-translator", + Description: "bi-directional translation between SPIR-V and LLVM IR", + Website: "https://github.com/KhronosGroup/SPIRV-LLVM-Translator", + + Dependencies: P{ + SPIRVTools, + }, + + ID: 227273, + } +} |
