yuzu/externals/sirit/src/instructions/annotation.cpp

28 lines
865 B
C++
Raw Normal View History

2020-12-28 19:15:37 +04:00
/* This file is part of the sirit project.
* Copyright (c) 2019 sirit
* This software may be used and distributed according to the terms of the
* 3-Clause BSD License
*/
2021-07-10 01:54:15 +04:00
#include <span>
2020-12-28 19:15:37 +04:00
#include "sirit/sirit.h"
2021-07-10 01:54:15 +04:00
#include "stream.h"
2020-12-28 19:15:37 +04:00
namespace Sirit {
2021-07-10 01:54:15 +04:00
Id Module::Decorate(Id target, spv::Decoration decoration, std::span<const Literal> literals) {
annotations->Reserve(3 + literals.size());
return *annotations << spv::Op::OpDecorate << target << decoration << literals << EndOp{};
2020-12-28 19:15:37 +04:00
}
Id Module::MemberDecorate(Id structure_type, Literal member, spv::Decoration decoration,
2021-07-10 01:54:15 +04:00
std::span<const Literal> literals) {
annotations->Reserve(4 + literals.size());
return *annotations << spv::Op::OpMemberDecorate << structure_type << member << decoration
<< literals << EndOp{};
2020-12-28 19:15:37 +04:00
}
} // namespace Sirit