summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/node.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-01-05 20:23:24 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2020-01-24 21:43:30 +0100
commit603c861532ed1a89254556ff84bbe121bd700765 (patch)
tree8bf8f67ff6393ce7b00b04a3b4b2d596cd8eb5bc /src/video_core/shader/node.h
parentShader_IR: Address Feedback (diff)
downloadyuzu-603c861532ed1a89254556ff84bbe121bd700765.tar
yuzu-603c861532ed1a89254556ff84bbe121bd700765.tar.gz
yuzu-603c861532ed1a89254556ff84bbe121bd700765.tar.bz2
yuzu-603c861532ed1a89254556ff84bbe121bd700765.tar.lz
yuzu-603c861532ed1a89254556ff84bbe121bd700765.tar.xz
yuzu-603c861532ed1a89254556ff84bbe121bd700765.tar.zst
yuzu-603c861532ed1a89254556ff84bbe121bd700765.zip
Diffstat (limited to 'src/video_core/shader/node.h')
-rw-r--r--src/video_core/shader/node.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/video_core/shader/node.h b/src/video_core/shader/node.h
index 075c7d07c..b370df8f9 100644
--- a/src/video_core/shader/node.h
+++ b/src/video_core/shader/node.h
@@ -230,6 +230,12 @@ using Node = std::shared_ptr<NodeData>;
using Node4 = std::array<Node, 4>;
using NodeBlock = std::vector<Node>;
+class BindlessSamplerNode;
+class ArraySamplerNode;
+
+using TrackSamplerData = std::variant<BindlessSamplerNode, ArraySamplerNode>;
+using TrackSampler = std::shared_ptr<TrackSamplerData>;
+
class Sampler {
public:
/// This constructor is for bound samplers
@@ -288,6 +294,48 @@ private:
bool is_bindless{}; ///< Whether this sampler belongs to a bindless texture or not.
};
+/// Represents a tracked bindless sampler into a direct const buffer
+class ArraySamplerNode final {
+public:
+ explicit ArraySamplerNode(u32 index, u32 base_offset, u32 bindless_var)
+ : index{index}, base_offset{base_offset}, bindless_var{bindless_var} {}
+
+ u32 GetIndex() const {
+ return index;
+ }
+
+ u32 GetBaseOffset() const {
+ return base_offset;
+ }
+
+ u32 GetIndexVar() const {
+ return bindless_var;
+ }
+
+private:
+ u32 index;
+ u32 base_offset;
+ u32 bindless_var;
+};
+
+/// Represents a tracked bindless sampler into a direct const buffer
+class BindlessSamplerNode final {
+public:
+ explicit BindlessSamplerNode(u32 index, u32 offset) : index{index}, offset{offset} {}
+
+ u32 GetIndex() const {
+ return index;
+ }
+
+ u32 GetOffset() const {
+ return offset;
+ }
+
+private:
+ u32 index;
+ u32 offset;
+};
+
class Image final {
public:
/// This constructor is for bound images