Updated spirv-tools.

This commit is contained in:
Бранимир Караџић
2020-09-25 19:56:23 -07:00
parent 4b802cb2ab
commit 1385c024d2
4 changed files with 61 additions and 4 deletions

View File

@@ -45,6 +45,14 @@ spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
// TODO: Validation checking?
pHeader->magic = spvFixWord(binary->code[SPV_INDEX_MAGIC_NUMBER], endian);
pHeader->version = spvFixWord(binary->code[SPV_INDEX_VERSION_NUMBER], endian);
// Per 2.3.1 version's high and low bytes are 0
if ((pHeader->version & 0x000000ff) || pHeader->version & 0xff000000)
return SPV_ERROR_INVALID_BINARY;
// Minimum version was 1.0 and max version is defined by SPV_VERSION.
if (pHeader->version < SPV_SPIRV_VERSION_WORD(1, 0) ||
pHeader->version > SPV_VERSION)
return SPV_ERROR_INVALID_BINARY;
pHeader->generator =
spvFixWord(binary->code[SPV_INDEX_GENERATOR_NUMBER], endian);
pHeader->bound = spvFixWord(binary->code[SPV_INDEX_BOUND], endian);