aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/value.cpp
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-03-26 16:02:04 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-22 21:51:24 -0400
commit742d11c2ad948c8630be15901514ec9e5e5fcd20 (patch)
tree4d9e0976f8c95fbb5c8006b46579200315b04f0f /src/shader_recompiler/frontend/ir/value.cpp
parent981eb6f43bb88f1e57b4c657bf37cb7471a113e3 (diff)
shader: Implement TLD4.PTP
Diffstat (limited to 'src/shader_recompiler/frontend/ir/value.cpp')
-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 e8e4662e7b..7671fc3d80 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 {
return type == Type::Void;
}
+bool Value::IsConstantContainer() const {
+ if (IsImmediate()) {
+ return true;
+ }
+ ValidateAccess(Type::Opaque);
+ auto num_args = inst->NumArgs();
+ for (size_t i = 0; i < num_args; i++) {
+ if (!inst->Arg(i).IsConstantContainer()) {
+ return false;
+ }
+ }
+ return true;
+}
+
bool Value::IsImmediate() const noexcept {
if (IsIdentity()) {
return inst->Arg(0).IsImmediate();