summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/value.cpp
diff options
context:
space:
mode:
authorGravatar FernandoS272021-03-26 16:02:04 +0100
committerGravatar ameerj2021-07-22 21:51:24 -0400
commit742d11c2ad948c8630be15901514ec9e5e5fcd20 (patch)
tree4d9e0976f8c95fbb5c8006b46579200315b04f0f /src/shader_recompiler/frontend/ir/value.cpp
parentshader: Fix Array Indices in TEX/TLD4 (diff)
downloadyuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.gz
yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.tar.xz
yuzu-742d11c2ad948c8630be15901514ec9e5e5fcd20.zip
shader: Implement TLD4.PTP
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/value.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp
index e8e4662e7..7671fc3d8 100644
--- a/src/shader_recompiler/frontend/ir/value.cpp
+++ b/src/shader_recompiler/frontend/ir/value.cpp
@@ -44,6 +44,20 @@ bool Value::IsEmpty() const noexcept {
44 return type == Type::Void; 44 return type == Type::Void;
45} 45}
46 46
47bool Value::IsConstantContainer() const {
48 if (IsImmediate()) {
49 return true;
50 }
51 ValidateAccess(Type::Opaque);
52 auto num_args = inst->NumArgs();
53 for (size_t i = 0; i < num_args; i++) {
54 if (!inst->Arg(i).IsConstantContainer()) {
55 return false;
56 }
57 }
58 return true;
59}
60
47bool Value::IsImmediate() const noexcept { 61bool Value::IsImmediate() const noexcept {
48 if (IsIdentity()) { 62 if (IsIdentity()) {
49 return inst->Arg(0).IsImmediate(); 63 return inst->Arg(0).IsImmediate();