MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / decodeString

Method decodeString

SPIRV/disassemble.cpp:304–326  ·  view source on GitHub ↗

decode string from words at current position (non-consuming)

Source from the content-addressed store, hash-verified

302
303// decode string from words at current position (non-consuming)
304std::pair<int, std::string> SpirvStream::decodeString()
305{
306 std::string res;
307 int wordPos = word;
308 char c;
309 bool done = false;
310
311 do {
312 unsigned int content = stream[wordPos];
313 for (int charCount = 0; charCount < 4; ++charCount) {
314 c = content & 0xff;
315 content >>= 8;
316 if (c == '\0') {
317 done = true;
318 break;
319 }
320 res += c;
321 }
322 ++wordPos;
323 } while(! done);
324
325 return std::make_pair(wordPos - word, res);
326}
327
328// return the number of operands consumed by the string
329int SpirvStream::disassembleString()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected