aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sirit.cpp
diff options
context:
space:
mode:
authorcomex <[email protected]>2020-11-24 18:24:28 -0500
committerRodrigo Locatti <[email protected]>2020-11-26 17:18:44 -0300
commit63c5b548c530df7fe598a543aa20ba7eaa2b5eb4 (patch)
treea7fe47b6260dd9b867af49ce5bb22955c1e02cca /src/sirit.cpp
parent13396c96ac5895240b846a1938655541e91b079a (diff)
downloadsirit-63c5b548c530df7fe598a543aa20ba7eaa2b5eb4.tar.gz
sirit-63c5b548c530df7fe598a543aa20ba7eaa2b5eb4.zip
Fix OpExtension.
There were two issues: - The word0 was omitted entirely. - The word count didn't account for the nul terminator.
Diffstat (limited to 'src/sirit.cpp')
-rw-r--r--src/sirit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sirit.cpp b/src/sirit.cpp
index a2043ae..3c9d97d 100644
--- a/src/sirit.cpp
+++ b/src/sirit.cpp
@@ -42,8 +42,10 @@ std::vector<u32> Module::Assemble() const {
}
for (const std::string_view extension_name : extensions) {
+ size_t count = WordsInString(extension_name);
+ words.push_back(MakeWord0(spv::Op::OpExtension, count + 1));
size_t insert_index = words.size();
- words.resize(words.size() + WordsInString(extension_name));
+ words.resize(words.size() + count);
InsertStringView(words, insert_index, extension_name);
}