i->content.visit(*this);
}
- writer.finalize(next_id);
+ writer.finalize(SPIRV_GENERATOR_MSP, next_id);
}
SpirVGenerator::StorageClass SpirVGenerator::get_interface_storage(const string &iface, bool block)
enum SpirVConstants
{
SPIRV_MAGIC = 0x07230203,
- SPIRV_MAGIC_REVERSED = 0x03022307
+ SPIRV_MAGIC_REVERSED = 0x03022307,
+ SPIRV_GENERATOR_MSP = 29
};
enum SpirVOpcode
content.function_body.clear();
}
-void SpirVWriter::finalize(Id id_bound)
+void SpirVWriter::finalize(unsigned generator, Id id_bound)
{
content.code.push_back(SPIRV_MAGIC);
content.code.push_back(0x00010500);
- content.code.push_back(0); // Generator
+ content.code.push_back(generator<<16);
content.code.push_back(id_bound);
content.code.push_back(0); // Reserved
append(content.code, content.capabilities);
bool has_current_block() const { return current_block_id; }
void begin_function_body(Id);
void end_function_body();
- void finalize(Id);
+ void finalize(unsigned, Id);
};
} // namespace SL