upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/spirv_interface.py
diff options
context:
space:
mode:
authorleather147 <139921639+lumenpearson@users.noreply.github.com>2026-11-23 02:17:11 +0300
committerleather147 <139921639+lumenpearson@users.noreply.github.com>2026-11-23 02:17:11 +0300
commitdc33bf95712f1f3fedbda422b5d25e35e448de46 (patch)
tree23da7963c9efc0a758ff0c6550631acb5e687738 /tools/spirv_interface.py
parentaa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff)
spirv_interface: accept repeated interface IDs before SPIR-V 1.4
Diffstat (limited to 'tools/spirv_interface.py')
-rw-r--r--tools/spirv_interface.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/spirv_interface.py b/tools/spirv_interface.py
index 1216175b8..6bc5b6336 100644
--- a/tools/spirv_interface.py
+++ b/tools/spirv_interface.py
@@ -228,6 +228,7 @@ def decode_literal_string(words):
228class Module: 228class Module:
229 def __init__(self, data): 229 def __init__(self, data):
230 words = parse_words(data) 230 words = parse_words(data)
231 self.version = words[1]
231 self.bound = words[3] 232 self.bound = words[3]
232 self.types = {} 233 self.types = {}
233 self.constants = {} 234 self.constants = {}
@@ -285,7 +286,10 @@ class Module:
285 ids = tuple(rest[words_used:]) 286 ids = tuple(rest[words_used:])
286 for identifier in ids: 287 for identifier in ids:
287 self.require_id(identifier) 288 self.require_id(identifier)
288 if len(set(ids)) != len(ids): 289 if self.version < 0x00010400:
290 # OpEntryPoint permits repeated interface IDs before SPIR-V 1.4.
291 ids = tuple(dict.fromkeys(ids))
292 elif len(set(ids)) != len(ids):
289 raise InterfaceError(f"duplicate entry-point interface ID in {name!r}") 293 raise InterfaceError(f"duplicate entry-point interface ID in {name!r}")
290 self.entry_points.append(EntryPoint(model, name, ids)) 294 self.entry_points.append(EntryPoint(model, name, ids))
291 elif opcode in (OP_DECORATE, OP_MEMBER_DECORATE): 295 elif opcode in (OP_DECORATE, OP_MEMBER_DECORATE):