spirv: Store SPIR-V version of the module

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8786>
This commit is contained in:
Caio Marcelo de Oliveira Filho 2021-01-11 11:51:24 -08:00 committed by Marge Bot
parent a0d73ca65c
commit 1869072c80
2 changed files with 5 additions and 2 deletions

View file

@ -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;
}

View file

@ -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;