Lines Matching refs:stream
86 // Container class for a single instance of a SPIR-V stream, with methods for disassembly.
89 SpirvStream(std::ostream& out, const std::vector<unsigned int>& stream) : out(out), stream(stream), word(0), nextNestedControl(0) { }
98 Op getOpCode(int id) const { return idInstruction[id] ? (Op)(stream[idInstruction[id]] & OpCodeMask) : OpNop; }
115 const std::vector<unsigned int>& stream; // the actual word stream
116 int size; // the size of the word stream
117 int word; // the next word of the stream to read
121 std::vector<unsigned int> idInstruction; // the word offset into the stream where the instruction for result [id] starts; 0 if not yet seen (forward reference or function parameter)
135 size = (int)stream.size();
137 Kill(out, "stream is too short");
140 if (stream[word++] != MagicNumber) {
146 out << "// Module Version " << std::hex << stream[word++] << std::endl;
149 out << "// Generated by (magic number): " << std::hex << stream[word++] << std::dec << std::endl;
152 bound = stream[word++];
159 schema = stream[word++];
173 unsigned int firstWord = stream[word];
181 Kill(out, "stream instruction terminated too early");
189 typeId = stream[word++];
196 resultId = stream[word++];
285 out << stream[word++];
294 outputId(stream[word++]);
309 unsigned int content = stream[wordPos];
347 nextNestedControl = stream[word];
360 switch (stream[word]) {
369 switch (stream[word]) {
386 if (idDescriptor[stream[word]].size() > 0) {
387 idDescriptor[resultId].append(idDescriptor[stream[word]].begin(), idDescriptor[stream[word]].begin() + 1);
388 if (strstr(idDescriptor[stream[word]].c_str(), "8")) {
391 if (strstr(idDescriptor[stream[word]].c_str(), "16")) {
394 if (strstr(idDescriptor[stream[word]].c_str(), "64")) {
399 switch (stream[word + 1]) {
422 out << " " << DimensionString((Dim)stream[word++]);
423 out << (stream[word++] != 0 ? " depth" : "");
424 out << (stream[word++] != 0 ? " array" : "");
425 out << (stream[word++] != 0 ? " multi-sampled" : "");
426 switch (stream[word++]) {
431 out << " format:" << ImageFormatString((ImageFormat)stream[word++]);
434 out << " " << AccessQualifierString(stream[word++]);
451 idDescriptor[stream[word - 1]] = decodeString().second;
457 outputMask(OperandImageOperands, stream[word++]);
463 if ((opCode == OpDecorate && stream[word - 1] == DecorationBuiltIn) ||
464 (opCode == OpMemberDecorate && stream[word - 1] == DecorationBuiltIn)) {
465 out << BuiltInString(stream[word++]);
502 const char* name = idDescriptor[stream[word - 2]].c_str();
524 unsigned entrypoint = stream[word - 1];
550 outputMask(OperandMemoryAccess, stream[word++]);
554 if (stream[word-1] & MemoryAccessAlignedMask) {
566 outputMask(operandClass, stream[word++]);
568 out << OperandClassParams[operandClass].getName(stream[word++]);
814 void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
816 SpirvStream SpirvStream(out, stream);