summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/maxwell/location.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-02-11 20:39:06 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:22 +0200
commit9170200a11715d131645d1ffb92e86e6ef0d7e88 (patch)
tree6c6f84c38a9b59d023ecb09c0737ea56da166b64 /src/shader_recompiler/frontend/maxwell/location.h
parentspirv: Initial SPIR-V support (diff)
downloadyuzu-9170200a11715d131645d1ffb92e86e6ef0d7e88.tar
yuzu-9170200a11715d131645d1ffb92e86e6ef0d7e88.tar.gz
yuzu-9170200a11715d131645d1ffb92e86e6ef0d7e88.tar.bz2
yuzu-9170200a11715d131645d1ffb92e86e6ef0d7e88.tar.lz
yuzu-9170200a11715d131645d1ffb92e86e6ef0d7e88.tar.xz
yuzu-9170200a11715d131645d1ffb92e86e6ef0d7e88.tar.zst
yuzu-9170200a11715d131645d1ffb92e86e6ef0d7e88.zip
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/location.h')
-rw-r--r--src/shader_recompiler/frontend/maxwell/location.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/location.h b/src/shader_recompiler/frontend/maxwell/location.h
index 66b51a19e..26d29eae2 100644
--- a/src/shader_recompiler/frontend/maxwell/location.h
+++ b/src/shader_recompiler/frontend/maxwell/location.h
@@ -15,7 +15,7 @@
namespace Shader::Maxwell {
class Location {
- static constexpr u32 VIRTUAL_OFFSET{std::numeric_limits<u32>::max()};
+ static constexpr u32 VIRTUAL_BIAS{4};
public:
constexpr Location() = default;
@@ -27,12 +27,18 @@ public:
Align();
}
+ constexpr Location Virtual() const noexcept {
+ Location virtual_location;
+ virtual_location.offset = offset - VIRTUAL_BIAS;
+ return virtual_location;
+ }
+
[[nodiscard]] constexpr u32 Offset() const noexcept {
return offset;
}
[[nodiscard]] constexpr bool IsVirtual() const {
- return offset == VIRTUAL_OFFSET;
+ return offset % 8 == VIRTUAL_BIAS;
}
constexpr auto operator<=>(const Location&) const noexcept = default;
@@ -89,7 +95,7 @@ private:
offset -= 8 + (offset % 32 == 8 ? 8 : 0);
}
- u32 offset{VIRTUAL_OFFSET};
+ u32 offset{0xcccccccc};
};
} // namespace Shader::Maxwell