diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 8c1366cd006..1b910fd1c16 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -5716,8 +5716,10 @@ vtn_create_builder(const uint32_t *words, size_t word_count, vtn_err("words[0] was 0x%x, want 0x%x", words[0], SpvMagicNumber); goto fail; } - if (words[1] < 0x10000) { - vtn_err("words[1] was 0x%x, want >= 0x10000", words[1]); + + b->version = words[1]; + if (b->version < 0x10000) { + vtn_err("version was 0x%x, want >= 0x10000", b->version); goto fail; } diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index e3ea3eb25c0..858194def66 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -648,6 +648,7 @@ struct vtn_builder { const uint32_t *spirv; size_t spirv_word_count; + uint32_t version; nir_shader *shader; struct spirv_to_nir_options *options;