summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-22 08:32:57 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:36 +0200
commit65c6f73e436ba3116030277a7a8bcb563f9554e2 (patch)
tree379f8ed7647aa543e54ef953cc39d761b85c192e /src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp
parentglsl: Add many FP32/64 instructions (diff)
downloadyuzu-65c6f73e436ba3116030277a7a8bcb563f9554e2.tar
yuzu-65c6f73e436ba3116030277a7a8bcb563f9554e2.tar.gz
yuzu-65c6f73e436ba3116030277a7a8bcb563f9554e2.tar.bz2
yuzu-65c6f73e436ba3116030277a7a8bcb563f9554e2.tar.lz
yuzu-65c6f73e436ba3116030277a7a8bcb563f9554e2.tar.xz
yuzu-65c6f73e436ba3116030277a7a8bcb563f9554e2.tar.zst
yuzu-65c6f73e436ba3116030277a7a8bcb563f9554e2.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp
index e69de29bb..e4781c03c 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp
@@ -0,0 +1,29 @@
+// Copyright 2021 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include <string_view>
+
+#include "shader_recompiler/backend/glsl/emit_context.h"
+#include "shader_recompiler/backend/glsl/emit_glsl_instructions.h"
+#include "shader_recompiler/frontend/ir/value.h"
+#include "shader_recompiler/profile.h"
+
+namespace Shader::Backend::GLSL {
+
+void EmitLogicalOr(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
+ ctx.AddU1("{}={}||{};", inst, a, b);
+}
+
+void EmitLogicalAnd(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
+ ctx.AddU1("{}={}&&{};", inst, a, b);
+}
+
+void EmitLogicalXor(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) {
+ ctx.AddU1("{}={}^^{};", inst, a, b);
+}
+
+void EmitLogicalNot(EmitContext& ctx, IR::Inst& inst, std::string_view value) {
+ ctx.AddU1("{}=!{};", inst, value);
+}
+} // namespace Shader::Backend::GLSL