From 603c861532ed1a89254556ff84bbe121bd700765 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 5 Jan 2020 15:23:24 -0400 Subject: Shader_IR: Implement initial code for tracking indexed samplers. --- src/video_core/shader/node.h | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/video_core/shader/node.h') 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; using Node4 = std::array; using NodeBlock = std::vector; +class BindlessSamplerNode; +class ArraySamplerNode; + +using TrackSamplerData = std::variant; +using TrackSampler = std::shared_ptr; + 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 -- cgit v1.2.3