2018-10-31 04:26:35 -03:00
|
|
|
/* This file is part of the sirit project.
|
2019-07-14 18:48:59 -03:00
|
|
|
* Copyright (c) 2019 sirit
|
|
|
|
|
* This software may be used and distributed according to the terms of the
|
|
|
|
|
* 3-Clause BSD License
|
2018-10-31 04:26:35 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "sirit/sirit.h"
|
|
|
|
|
|
2020-08-01 01:50:01 -03:00
|
|
|
#include "stream.h"
|
|
|
|
|
|
2018-10-31 04:26:35 -03:00
|
|
|
namespace Sirit {
|
|
|
|
|
|
2018-10-31 22:20:49 -03:00
|
|
|
Id Module::OpUndef(Id result_type) {
|
2020-08-01 01:50:01 -03:00
|
|
|
code->Reserve(3);
|
|
|
|
|
return *code << OpId{spv::Op::OpUndef, result_type} << EndOp{};
|
2018-10-31 04:26:35 -03:00
|
|
|
}
|
|
|
|
|
|
2021-04-12 03:55:25 -03:00
|
|
|
void Module::OpEmitVertex() {
|
2020-08-01 01:50:01 -03:00
|
|
|
code->Reserve(1);
|
2021-04-12 03:55:25 -03:00
|
|
|
*code << spv::Op::OpEmitVertex << EndOp{};
|
2019-10-31 20:23:57 -03:00
|
|
|
}
|
|
|
|
|
|
2021-04-12 03:55:25 -03:00
|
|
|
void Module::OpEndPrimitive() {
|
2020-08-01 01:50:01 -03:00
|
|
|
code->Reserve(1);
|
2021-04-12 03:55:25 -03:00
|
|
|
*code << spv::Op::OpEndPrimitive << EndOp{};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Module::OpEmitStreamVertex(Id stream) {
|
|
|
|
|
code->Reserve(2);
|
|
|
|
|
*code << spv::Op::OpEmitStreamVertex << stream << EndOp{};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Module::OpEndStreamPrimitive(Id stream) {
|
|
|
|
|
code->Reserve(2);
|
|
|
|
|
*code << spv::Op::OpEndStreamPrimitive << stream << EndOp{};
|
2019-10-31 20:23:57 -03:00
|
|
|
}
|
|
|
|
|
|
2018-10-31 04:26:35 -03:00
|
|
|
} // namespace Sirit
|