glsl: Reusable typed variables. IADD32
This commit is contained in:
parent
faf4cd72c5
commit
e221baccdd
6 changed files with 311 additions and 203 deletions
|
@ -31,9 +31,33 @@ class EmitContext {
|
|||
public:
|
||||
explicit EmitContext(IR::Program& program, Bindings& bindings, const Profile& profile_);
|
||||
|
||||
// template <typename... Args>
|
||||
// void Add(const char* format_str, IR::Inst& inst, Args&&... args) {
|
||||
// code += fmt::format(format_str, reg_alloc.Define(inst), std::forward<Args>(args)...);
|
||||
// // TODO: Remove this
|
||||
// code += '\n';
|
||||
// }
|
||||
|
||||
template <typename... Args>
|
||||
void Add(const char* format_str, IR::Inst& inst, Args&&... args) {
|
||||
code += fmt::format(format_str, reg_alloc.Define(inst), std::forward<Args>(args)...);
|
||||
void AddU32(const char* format_str, IR::Inst& inst, Args&&... args) {
|
||||
code +=
|
||||
fmt::format(format_str, reg_alloc.Define(inst, Type::U32), std::forward<Args>(args)...);
|
||||
// TODO: Remove this
|
||||
code += '\n';
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void AddS32(const char* format_str, IR::Inst& inst, Args&&... args) {
|
||||
code +=
|
||||
fmt::format(format_str, reg_alloc.Define(inst, Type::S32), std::forward<Args>(args)...);
|
||||
// TODO: Remove this
|
||||
code += '\n';
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void AddF32(const char* format_str, IR::Inst& inst, Args&&... args) {
|
||||
code +=
|
||||
fmt::format(format_str, reg_alloc.Define(inst, Type::F32), std::forward<Args>(args)...);
|
||||
// TODO: Remove this
|
||||
code += '\n';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue