diff options
| author | 2021-05-24 19:33:11 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:36 -0400 | |
| commit | e99d01ff5308bb239aa2007ba4363d3a77f4d202 (patch) | |
| tree | d01d0c54c42b15a140fa51f409d187ebe44016eb /src/shader_recompiler/backend/glsl/reg_alloc.cpp | |
| parent | glsl: Wip storage atomic ops (diff) | |
| download | yuzu-e99d01ff5308bb239aa2007ba4363d3a77f4d202.tar.gz yuzu-e99d01ff5308bb239aa2007ba4363d3a77f4d202.tar.xz yuzu-e99d01ff5308bb239aa2007ba4363d3a77f4d202.zip | |
glsl: implement phi nodes
Diffstat (limited to 'src/shader_recompiler/backend/glsl/reg_alloc.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/reg_alloc.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glsl/reg_alloc.cpp b/src/shader_recompiler/backend/glsl/reg_alloc.cpp index 8db1391fd..58c2c408e 100644 --- a/src/shader_recompiler/backend/glsl/reg_alloc.cpp +++ b/src/shader_recompiler/backend/glsl/reg_alloc.cpp | |||
| @@ -74,6 +74,23 @@ std::string RegAlloc::Define(IR::Inst& inst, Type type) { | |||
| 74 | return type_str + Representation(id); | 74 | return type_str + Representation(id); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | std::string RegAlloc::Define(IR::Inst& inst, IR::Type type) { | ||
| 78 | switch (type) { | ||
| 79 | case IR::Type::U1: | ||
| 80 | return Define(inst, Type::U1); | ||
| 81 | case IR::Type::U32: | ||
| 82 | return Define(inst, Type::U32); | ||
| 83 | case IR::Type::F32: | ||
| 84 | return Define(inst, Type::F32); | ||
| 85 | case IR::Type::U64: | ||
| 86 | return Define(inst, Type::U64); | ||
| 87 | case IR::Type::F64: | ||
| 88 | return Define(inst, Type::F64); | ||
| 89 | default: | ||
| 90 | throw NotImplementedException("IR type {}", type); | ||
| 91 | } | ||
| 92 | } | ||
| 93 | |||
| 77 | std::string RegAlloc::Consume(const IR::Value& value) { | 94 | std::string RegAlloc::Consume(const IR::Value& value) { |
| 78 | return value.IsImmediate() ? MakeImm(value) : Consume(*value.InstRecursive()); | 95 | return value.IsImmediate() ? MakeImm(value) : Consume(*value.InstRecursive()); |
| 79 | } | 96 | } |