diff options
| author | 2021-02-24 05:21:30 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:22 -0400 | |
| commit | e87a502da2d5a8356a639d53c0a16a77890de4c7 (patch) | |
| tree | 00fd1a9a32c0334c49189098829b782a37533c46 /src/shader_recompiler/frontend/ir/value.cpp | |
| parent | shader: Implement more of XMAD and FFMA32I and fix XMAD.CBCC (diff) | |
| download | yuzu-e87a502da2d5a8356a639d53c0a16a77890de4c7.tar.gz yuzu-e87a502da2d5a8356a639d53c0a16a77890de4c7.tar.xz yuzu-e87a502da2d5a8356a639d53c0a16a77890de4c7.zip | |
shader: Fix control flow
Diffstat (limited to '')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/value.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp index 718314213..791ba2690 100644 --- a/src/shader_recompiler/frontend/ir/value.cpp +++ b/src/shader_recompiler/frontend/ir/value.cpp | |||
| @@ -36,6 +36,10 @@ bool Value::IsIdentity() const noexcept { | |||
| 36 | return type == Type::Opaque && inst->Opcode() == Opcode::Identity; | 36 | return type == Type::Opaque && inst->Opcode() == Opcode::Identity; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | bool Value::IsPhi() const noexcept { | ||
| 40 | return type == Type::Opaque && inst->Opcode() == Opcode::Phi; | ||
| 41 | } | ||
| 42 | |||
| 39 | bool Value::IsEmpty() const noexcept { | 43 | bool Value::IsEmpty() const noexcept { |
| 40 | return type == Type::Void; | 44 | return type == Type::Void; |
| 41 | } | 45 | } |
| @@ -52,7 +56,7 @@ bool Value::IsLabel() const noexcept { | |||
| 52 | } | 56 | } |
| 53 | 57 | ||
| 54 | IR::Type Value::Type() const noexcept { | 58 | IR::Type Value::Type() const noexcept { |
| 55 | if (IsIdentity()) { | 59 | if (IsIdentity() || IsPhi()) { |
| 56 | return inst->Arg(0).Type(); | 60 | return inst->Arg(0).Type(); |
| 57 | } | 61 | } |
| 58 | if (type == Type::Opaque) { | 62 | if (type == Type::Opaque) { |