commit:     7a3463fec0d2019eb5d8959fa4cf63a74be1f058
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  1 03:36:29 2026 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Thu Jan  1 03:36:53 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a3463fe

dev-util/spirv-llvm-translator: Fix test failure

Closes: https://bugs.gentoo.org/964959
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 ...lator-21.1.3-fix-DecorateUniformId.spvasm.patch | 43 ++++++++++++++++++++++
 .../spirv-llvm-translator-21.1.3.ebuild            |  4 ++
 2 files changed, 47 insertions(+)

diff --git 
a/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-21.1.3-fix-DecorateUniformId.spvasm.patch
 
b/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-21.1.3-fix-DecorateUniformId.spvasm.patch
new file mode 100644
index 000000000000..2bfa38fc31d8
--- /dev/null
+++ 
b/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-21.1.3-fix-DecorateUniformId.spvasm.patch
@@ -0,0 +1,43 @@
+From fc5873ee760c333738c9e8e8d8c2eb906f0c40f5 Mon Sep 17 00:00:00 2001
+From: Ben Ashbaugh <[email protected]>
+Date: Fri, 8 Aug 2025 08:56:05 -0700
+Subject: [PATCH] fixes a new validation failure in a UniformId test (#3301)
+
+A recent spirv-val change requires that OpDecorateId IDs are
+well-ordered, which means that the decoration operand ID cannot be the
+same as the decoration target ID. See:
+https://github.com/KhronosGroup/SPIRV-Tools/pull/6227
+
+This leads to the failure:
+
+```
+error: line 6: Parameter <ID> '2[%uint_0]' must appear earlier in the binary 
than the target
+  OpDecorateId %uint_0 UniformId %uint_0
+```
+
+The fix is to use a different ID for the decoration operand and the
+decoration target.
+---
+ test/DecorateUniformId.spvasm | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git ./test/DecorateUniformId.spvasm ./test/DecorateUniformId.spvasm
+index b50c6b50..d22bf6bd 100644
+--- ./test/DecorateUniformId.spvasm
++++ ./test/DecorateUniformId.spvasm
+@@ -15,9 +15,10 @@
+                OpCapability UniformDecoration
+                OpMemoryModel Physical64 OpenCL
+                OpEntryPoint Kernel %2 "test"
+-               OpDecorateId %uint_0 UniformId %uint_0
++               OpDecorateId %tgt_uint_0 UniformId %op_uint_0
+        %uint = OpTypeInt 32 0
+-     %uint_0 = OpConstant %uint 0
++  %op_uint_0 = OpConstant %uint 0
++ %tgt_uint_0 = OpConstant %uint 0
+        %void = OpTypeVoid
+           %1 = OpTypeFunction %void
+           %2 = OpFunction %void None %1
+-- 
+2.51.2
+

diff --git a/dev-util/spirv-llvm-translator/spirv-llvm-translator-21.1.3.ebuild 
b/dev-util/spirv-llvm-translator/spirv-llvm-translator-21.1.3.ebuild
index 5057e7005a0a..46b86ab069c3 100644
--- a/dev-util/spirv-llvm-translator/spirv-llvm-translator-21.1.3.ebuild
+++ b/dev-util/spirv-llvm-translator/spirv-llvm-translator-21.1.3.ebuild
@@ -35,6 +35,10 @@ BDEPEND="
        )
 "
 
+PATCHES=(
+       "${FILESDIR}"/${P}-fix-DecorateUniformId.spvasm.patch
+)
+
 src_prepare() {
        append-flags -fPIC
        cmake_src_prepare

Reply via email to