Files
sirit/src/insts/annotation.cpp

33 lines
948 B
C++
Raw Normal View History

2018-10-23 04:45:56 -03:00
/* This file is part of the sirit project.
* Copyright (c) 2018 ReinUsesLisp
* This software may be used and distributed according to the terms of the GNU
* Lesser General Public License version 2.1 or any later version.
*/
#include "insts.h"
#include "sirit/sirit.h"
namespace Sirit {
2018-10-31 22:20:49 -03:00
Id Module::Decorate(Id target, spv::Decoration decoration,
const std::vector<Literal>& literals) {
2018-10-23 05:05:40 -03:00
auto op{new Op(spv::Op::OpDecorate)};
2018-10-23 04:45:56 -03:00
op->Add(target);
AddEnum(op, decoration);
op->Add(literals);
2018-10-23 04:45:56 -03:00
return AddAnnotation(op);
}
2018-10-31 22:20:49 -03:00
Id Module::MemberDecorate(Id structure_type, Literal member,
spv::Decoration decoration,
const std::vector<Literal>& literals) {
2018-10-28 05:38:10 -03:00
auto op{new Op(spv::Op::OpMemberDecorate)};
op->Add(structure_type);
op->Add(member);
2018-10-28 05:38:10 -03:00
AddEnum(op, decoration);
op->Add(literals);
2018-10-28 05:38:10 -03:00
return AddAnnotation(op);
}
2018-10-23 04:45:56 -03:00
} // namespace Sirit