summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2021-07-25 11:39:04 -0700
committerGravatar GitHub2021-07-25 11:39:04 -0700
commit98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f (patch)
tree816faa96c2c4d291825063433331a8ea4b3d08f1 /src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
parentMerge pull request #6699 from lat9nq/common-threads (diff)
parentshader: Support out of bound local memory reads and immediate writes (diff)
downloadyuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.gz
yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.tar.xz
yuzu-98b26b6e126d4775fdf3f773fe8a8ac808a8ff8f.zip
Merge pull request #6585 from ameerj/hades
Shader Decompiler Rewrite
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_select.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_select.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
new file mode 100644
index 000000000..49fba9073
--- /dev/null
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_select.cpp
@@ -0,0 +1,55 @@
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
11namespace Shader::Backend::GLSL {
12void EmitSelectU1(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
13 std::string_view true_value, std::string_view false_value) {
14 ctx.AddU1("{}={}?{}:{};", inst, cond, true_value, false_value);
15}
16
17void EmitSelectU8([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond,
18 [[maybe_unused]] std::string_view true_value,
19 [[maybe_unused]] std::string_view false_value) {
20 NotImplemented();
21}
22
23void EmitSelectU16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond,
24 [[maybe_unused]] std::string_view true_value,
25 [[maybe_unused]] std::string_view false_value) {
26 NotImplemented();
27}
28
29void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
30 std::string_view true_value, std::string_view false_value) {
31 ctx.AddU32("{}={}?{}:{};", inst, cond, true_value, false_value);
32}
33
34void EmitSelectU64(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
35 std::string_view true_value, std::string_view false_value) {
36 ctx.AddU64("{}={}?{}:{};", inst, cond, true_value, false_value);
37}
38
39void EmitSelectF16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] std::string_view cond,
40 [[maybe_unused]] std::string_view true_value,
41 [[maybe_unused]] std::string_view false_value) {
42 NotImplemented();
43}
44
45void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
46 std::string_view true_value, std::string_view false_value) {
47 ctx.AddF32("{}={}?{}:{};", inst, cond, true_value, false_value);
48}
49
50void EmitSelectF64(EmitContext& ctx, IR::Inst& inst, std::string_view cond,
51 std::string_view true_value, std::string_view false_value) {
52 ctx.AddF64("{}={}?{}:{};", inst, cond, true_value, false_value);
53}
54
55} // namespace Shader::Backend::GLSL