Skip to content

Commit 902da89

Browse files
Henry Linjamäkipvelesko
authored andcommitted
Remove SPIR-V version check in the parser
For allowing SPIR-V modules of higher versions than v1.2. Drivers probably already check the SPIR-V version of the modules during device compilation so the check was probably redundant too.
1 parent 2d21d6e commit 902da89

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

src/spirv.cc

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ const std::string OpenCLStd{"OpenCL.std"};
4242
// them with instruction words.
4343
using InstWord = uint32_t;
4444

45-
static InstWord getSPVVersion(int Major, int Minor) {
46-
return (Major << 16) | (Minor << 8);
47-
}
48-
4945
static std::string_view parseLiteralString(const InstWord *WordBegin,
5046
size_t NumWords);
5147

@@ -208,18 +204,8 @@ static bool parseHeader(const InstWord *&WordBuffer, size_t &NumWords) {
208204
}
209205
++WordBuffer;
210206

211-
if (*WordBuffer < getSPVVersion(1, 0) || *WordBuffer > getSPVVersion(1, 2)) {
212-
logError("Unsupported SPIR-V version.");
213-
return false;
214-
}
215-
++WordBuffer;
216-
217-
// GENERATOR
218-
++WordBuffer;
219-
220-
// BOUND
221-
// InstWord Bound = *WordBuffer;
222-
++WordBuffer;
207+
// Jump over VERSION, GENERATOR and BOUND words.
208+
WordBuffer += 3;
223209

224210
// RESERVED
225211
if (*WordBuffer != 0) {

0 commit comments

Comments
 (0)