summaryrefslogtreecommitdiff
path: root/thirdparty/glslang/SPIRV/SPVRemapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/glslang/SPIRV/SPVRemapper.cpp')
-rw-r--r--thirdparty/glslang/SPIRV/SPVRemapper.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/thirdparty/glslang/SPIRV/SPVRemapper.cpp b/thirdparty/glslang/SPIRV/SPVRemapper.cpp
index 56d6d5d4a5..fdfbeb90cd 100644
--- a/thirdparty/glslang/SPIRV/SPVRemapper.cpp
+++ b/thirdparty/glslang/SPIRV/SPVRemapper.cpp
@@ -297,15 +297,21 @@ namespace spv {
std::string spirvbin_t::literalString(unsigned word) const
{
std::string literal;
+ const spirword_t * pos = spv.data() + word;
literal.reserve(16);
- const char* bytes = reinterpret_cast<const char*>(spv.data() + word);
-
- while (bytes && *bytes)
- literal += *bytes++;
-
- return literal;
+ do {
+ spirword_t word = *pos;
+ for (int i = 0; i < 4; i++) {
+ char c = word & 0xff;
+ if (c == '\0')
+ return literal;
+ literal += c;
+ word >>= 8;
+ }
+ pos++;
+ } while (true);
}
void spirvbin_t::applyMap()