mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-24 18:00:54 +00:00
Updated spirv-tools.
This commit is contained in:
8
3rdparty/spirv-tools/source/binary.cpp
vendored
8
3rdparty/spirv-tools/source/binary.cpp
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user