diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-02-05 05:58:02 -0300 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-22 21:51:21 -0400 |
commit | e81739493a0cacc1efe3295f9d287d5d31b1a989 (patch) | |
tree | 11a3d04ce9def535414a00226030798f337c053c /src/shader_recompiler/frontend/ir/value.cpp | |
parent | d24a16045f0f6b0b873d5e3b5bf187c1a8c4343f (diff) |
shader: Constant propagation and global memory to storage buffer
Diffstat (limited to 'src/shader_recompiler/frontend/ir/value.cpp')
-rw-r--r-- | src/shader_recompiler/frontend/ir/value.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp index 1e974e88c7..59a9b10dc9 100644 --- a/src/shader_recompiler/frontend/ir/value.cpp +++ b/src/shader_recompiler/frontend/ir/value.cpp @@ -91,26 +91,41 @@ IR::Attribute Value::Attribute() const { } bool Value::U1() const { + if (IsIdentity()) { + return inst->Arg(0).U1(); + } ValidateAccess(Type::U1); return imm_u1; } u8 Value::U8() const { + if (IsIdentity()) { + return inst->Arg(0).U8(); + } ValidateAccess(Type::U8); return imm_u8; } u16 Value::U16() const { + if (IsIdentity()) { + return inst->Arg(0).U16(); + } ValidateAccess(Type::U16); return imm_u16; } u32 Value::U32() const { + if (IsIdentity()) { + return inst->Arg(0).U32(); + } ValidateAccess(Type::U32); return imm_u32; } u64 Value::U64() const { + if (IsIdentity()) { + return inst->Arg(0).U64(); + } ValidateAccess(Type::U64); return imm_u64; } @@ -142,8 +157,6 @@ bool Value::operator==(const Value& other) const { return imm_u32 == other.imm_u32; case Type::U64: return imm_u64 == other.imm_u64; - case Type::ZSCO: - throw NotImplementedException("ZSCO comparison"); } throw LogicError("Invalid type {}", type); } |