summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_context.h
diff options
context:
space:
mode:
authorGravatar ameerj2021-05-21 02:00:12 -0400
committerGravatar ameerj2021-07-22 21:51:35 -0400
commite221baccddea3c0802c97e7f6f60c0c3e6a72b60 (patch)
tree4a94c1d2b662b2d7ace703334c41c575fc644510 /src/shader_recompiler/backend/glsl/emit_context.h
parentglsl: Fix program linking and cbuf (diff)
downloadyuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.tar.gz
yuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.tar.xz
yuzu-e221baccddea3c0802c97e7f6f60c0c3e6a72b60.zip
glsl: Reusable typed variables. IADD32
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 {
31public: 31public:
32 explicit EmitContext(IR::Program& program, Bindings& bindings, const Profile& profile_); 32 explicit EmitContext(IR::Program& program, Bindings& bindings, const Profile& profile_);
33 33
34 // template <typename... Args>
35 // void Add(const char* format_str, IR::Inst& inst, Args&&... args) {
36 // code += fmt::format(format_str, reg_alloc.Define(inst), std::forward<Args>(args)...);
37 // // TODO: Remove this
38 // code += '\n';
39 // }
40
41 template <typename... Args>
42 void AddU32(const char* format_str, IR::Inst& inst, Args&&... args) {
43 code +=
44 fmt::format(format_str, reg_alloc.Define(inst, Type::U32), std::forward<Args>(args)...);
45 // TODO: Remove this
46 code += '\n';
47 }
48
49 template <typename... Args>
50 void AddS32(const char* format_str, IR::Inst& inst, Args&&... args) {
51 code +=
52 fmt::format(format_str, reg_alloc.Define(inst, Type::S32), std::forward<Args>(args)...);
53 // TODO: Remove this
54 code += '\n';
55 }
56
34 template <typename... Args> 57 template <typename... Args>
35 void Add(const char* format_str, IR::Inst& inst, Args&&... args) { 58 void AddF32(const char* format_str, IR::Inst& inst, Args&&... args) {
36 code += fmt::format(format_str, reg_alloc.Define(inst), std::forward<Args>(args)...); 59 code +=
60 fmt::format(format_str, reg_alloc.Define(inst, Type::F32), std::forward<Args>(args)...);
37 // TODO: Remove this 61 // TODO: Remove this
38 code += '\n'; 62 code += '\n';
39 } 63 }