summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_context.h
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-21 08:00:12 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:35 +0200
commite221baccddea3c0802c97e7f6f60c0c3e6a72b60 (patch)
tree4a94c1d2b662b2d7ace703334c41c575fc644510 /src/shader_recompiler/backend/glsl/emit_context.h
parentglsl: Fix program linking and cbuf (diff)
downloadyuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.tar
yuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.tar.gz
yuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.tar.bz2
yuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.tar.lz
yuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.tar.xz
yuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.tar.zst
yuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.h')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.h b/src/shader_recompiler/backend/glsl/emit_context.h
index 8d093a853..81b970c14 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.h
+++ b/src/shader_recompiler/backend/glsl/emit_context.h
@@ -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 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 Add(const char* format_str, IR::Inst& inst, Args&&... args) {
- code += fmt::format(format_str, reg_alloc.Define(inst), std::forward<Args>(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';
}