summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/node.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-09-18 06:50:40 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-09-21 22:33:52 +0200
commit44000971e271e350638611b0265a3fed7bcced2a (patch)
treeb224df1c5477a7e31cb0176d9299b635c6363f61 /src/video_core/shader/node.h
parentshader/image: Implement SULD and remove irrelevant code (diff)
downloadyuzu-44000971e271e350638611b0265a3fed7bcced2a.tar
yuzu-44000971e271e350638611b0265a3fed7bcced2a.tar.gz
yuzu-44000971e271e350638611b0265a3fed7bcced2a.tar.bz2
yuzu-44000971e271e350638611b0265a3fed7bcced2a.tar.lz
yuzu-44000971e271e350638611b0265a3fed7bcced2a.tar.xz
yuzu-44000971e271e350638611b0265a3fed7bcced2a.tar.zst
yuzu-44000971e271e350638611b0265a3fed7bcced2a.zip
Diffstat (limited to 'src/video_core/shader/node.h')
-rw-r--r--src/video_core/shader/node.h46
1 files changed, 20 insertions, 26 deletions
diff --git a/src/video_core/shader/node.h b/src/video_core/shader/node.h
index e5b75783d..338bab17c 100644
--- a/src/video_core/shader/node.h
+++ b/src/video_core/shader/node.h
@@ -149,11 +149,10 @@ enum class OperationCode {
TextureQueryLod, /// (MetaTexture, float[N] coords) -> float4
TexelFetch, /// (MetaTexture, int[N], int) -> float4
- ImageLoad, /// (MetaImage, int[N] coords) -> void
- ImageStore, /// (MetaImage, int[N] coords) -> void
+ ImageLoad, /// (MetaImage, int[N] coords) -> void
+ ImageStore, /// (MetaImage, int[N] coords) -> void
+
AtomicImageAdd, /// (MetaImage, int[N] coords) -> void
- AtomicImageMin, /// (MetaImage, int[N] coords) -> void
- AtomicImageMax, /// (MetaImage, int[N] coords) -> void
AtomicImageAnd, /// (MetaImage, int[N] coords) -> void
AtomicImageOr, /// (MetaImage, int[N] coords) -> void
AtomicImageXor, /// (MetaImage, int[N] coords) -> void
@@ -295,21 +294,18 @@ private:
class Image final {
public:
- constexpr explicit Image(std::size_t offset, std::size_t index, Tegra::Shader::ImageType type,
- std::optional<Tegra::Shader::ImageAtomicSize> size)
- : offset{offset}, index{index}, type{type}, is_bindless{false}, size{size} {}
+ constexpr explicit Image(std::size_t offset, std::size_t index, Tegra::Shader::ImageType type)
+ : offset{offset}, index{index}, type{type}, is_bindless{false} {}
constexpr explicit Image(u32 cbuf_index, u32 cbuf_offset, std::size_t index,
- Tegra::Shader::ImageType type,
- std::optional<Tegra::Shader::ImageAtomicSize> size)
+ Tegra::Shader::ImageType type)
: offset{(static_cast<u64>(cbuf_index) << 32) | cbuf_offset}, index{index}, type{type},
- is_bindless{true}, size{size} {}
+ is_bindless{true} {}
constexpr explicit Image(std::size_t offset, std::size_t index, Tegra::Shader::ImageType type,
- bool is_bindless, bool is_written, bool is_read,
- std::optional<Tegra::Shader::ImageAtomicSize> size)
+ bool is_bindless, bool is_written, bool is_read, bool is_atomic)
: offset{offset}, index{index}, type{type}, is_bindless{is_bindless},
- is_written{is_written}, is_read{is_read}, size{size} {}
+ is_written{is_written}, is_read{is_read}, is_atomic{is_atomic} {}
void MarkWrite() {
is_written = true;
@@ -319,8 +315,10 @@ public:
is_read = true;
}
- void SetSize(Tegra::Shader::ImageAtomicSize size_) {
- size = size_;
+ void MarkAtomic() {
+ MarkWrite();
+ MarkRead();
+ is_atomic = true;
}
constexpr std::size_t GetOffset() const {
@@ -347,21 +345,17 @@ public:
return is_read;
}
- constexpr std::pair<u32, u32> GetBindlessCBuf() const {
- return {static_cast<u32>(offset >> 32), static_cast<u32>(offset)};
- }
-
- constexpr bool IsSizeKnown() const {
- return size.has_value();
+ constexpr bool IsAtomic() const {
+ return is_atomic;
}
- constexpr Tegra::Shader::ImageAtomicSize GetSize() const {
- return size.value();
+ constexpr std::pair<u32, u32> GetBindlessCBuf() const {
+ return {static_cast<u32>(offset >> 32), static_cast<u32>(offset)};
}
constexpr bool operator<(const Image& rhs) const {
- return std::tie(offset, index, type, size, is_bindless) <
- std::tie(rhs.offset, rhs.index, rhs.type, rhs.size, rhs.is_bindless);
+ return std::tie(offset, index, type, is_bindless) <
+ std::tie(rhs.offset, rhs.index, rhs.type, rhs.is_bindless);
}
private:
@@ -371,7 +365,7 @@ private:
bool is_bindless{};
bool is_written{};
bool is_read{};
- std::optional<Tegra::Shader::ImageAtomicSize> size{};
+ bool is_atomic{};
};
struct GlobalMemoryBase {