Add support for GLSLstd450 and OpFAbs

This commit is contained in:
ReinUsesLisp 2018-11-04 03:03:06 -03:00
parent 44043bca56
commit 6742afd6dd
4 changed files with 51 additions and 8 deletions

View file

@ -43,7 +43,9 @@ std::vector<u8> Module::Assemble() const {
for (const auto capability : capabilities) {
WriteEnum(stream, spv::Op::OpCapability, capability);
}
// TODO write extensions
if (glsl_std_450) {
glsl_std_450->Write(stream);
}
// TODO write ext inst imports
Op memory_model_ref{spv::Op::OpMemoryModel};
@ -123,4 +125,11 @@ Id Module::AddAnnotation(std::unique_ptr<Op> op) {
return id;
}
Id Module::GetGLSLstd450() {
if (!glsl_std_450) {
glsl_std_450 = std::make_unique<Op>(spv::Op::OpExtInstImport, bound++);
}
return glsl_std_450.get();
}
} // namespace Sirit