summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp')
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
index 6604d80945d..636dac8c875 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
@@ -123,8 +123,8 @@ class Parser {
// returned object will be propagated to the current parse's diagnostic
// object.
spvtools::DiagnosticStream diagnostic(spv_result_t error) {
- return spvtools::DiagnosticStream({0, 0, _.word_index}, consumer_, "",
- error);
+ return spvtools::DiagnosticStream({0, 0, _.instruction_count}, consumer_,
+ "", error);
}
// Returns a diagnostic stream object with the default parse error code.
@@ -179,6 +179,7 @@ class Parser {
num_words(num_words_arg),
diagnostic(diagnostic_arg),
word_index(0),
+ instruction_count(0),
endian(),
requires_endian_conversion(false) {
// Temporary storage for parser state within a single instruction.
@@ -192,6 +193,7 @@ class Parser {
size_t num_words; // Number of words in the module.
spv_diagnostic* diagnostic; // Where diagnostics go.
size_t word_index; // The current position in words.
+ size_t instruction_count; // The count of processed instructions
spv_endianness_t endian; // The endianness of the binary.
// Is the SPIR-V binary in a different endiannes from the host native
// endianness?
@@ -269,6 +271,8 @@ spv_result_t Parser::parseModule() {
}
spv_result_t Parser::parseInstruction() {
+ _.instruction_count++;
+
// The zero values for all members except for opcode are the
// correct initial values.
spv_parsed_instruction_t inst = {};