diff options
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp | 28 |
1 files changed, 28 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 new file mode 100644 index 000000000..338ff4bd6 --- /dev/null +++ b/src/shader_recompiler/backend/glsl/emit_glsl_logical.cpp | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <string_view> | ||
| 6 | |||
| 7 | #include "shader_recompiler/backend/glsl/emit_context.h" | ||
| 8 | #include "shader_recompiler/backend/glsl/emit_glsl_instructions.h" | ||
| 9 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 10 | |||
| 11 | namespace Shader::Backend::GLSL { | ||
| 12 | |||
| 13 | void EmitLogicalOr(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) { | ||
| 14 | ctx.AddU1("{}={}||{};", inst, a, b); | ||
| 15 | } | ||
| 16 | |||
| 17 | void EmitLogicalAnd(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) { | ||
| 18 | ctx.AddU1("{}={}&&{};", inst, a, b); | ||
| 19 | } | ||
| 20 | |||
| 21 | void EmitLogicalXor(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::string_view b) { | ||
| 22 | ctx.AddU1("{}={}^^{};", inst, a, b); | ||
| 23 | } | ||
| 24 | |||
| 25 | void EmitLogicalNot(EmitContext& ctx, IR::Inst& inst, std::string_view value) { | ||
| 26 | ctx.AddU1("{}=!{};", inst, value); | ||
| 27 | } | ||
| 28 | } // namespace Shader::Backend::GLSL | ||