From 5c280e6ff04ae36e8cd7ba81cce4ae89e0a49b80 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 7 Feb 2019 00:05:41 -0300 Subject: shader_ir: Implement STG, keep track of global memory usage and flush --- src/video_core/shader/shader_ir.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/video_core/shader/shader_ir.h') diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 4888998d3..1afab08c0 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h @@ -276,6 +276,11 @@ struct GlobalMemoryBase { } }; +struct GlobalMemoryUsage { + bool is_read{}; + bool is_written{}; +}; + struct MetaArithmetic { bool precise{}; }; @@ -578,8 +583,8 @@ public: return used_clip_distances; } - const std::set& GetGlobalMemoryBases() const { - return used_global_memory_bases; + const std::map& GetGlobalMemory() const { + return used_global_memory; } std::size_t GetLength() const { @@ -781,6 +786,11 @@ private: std::pair TrackRegister(const GprNode* tracked, const NodeBlock& code, s64 cursor); + std::tuple TrackAndGetGlobalMemory(NodeBlock& bb, + Node addr_register, + u32 immediate_offset, + bool is_write); + template Node Operation(OperationCode code, const T*... operands) { return StoreNode(OperationNode(code, operands...)); @@ -834,7 +844,7 @@ private: std::map used_cbufs; std::set used_samplers; std::array used_clip_distances{}; - std::set used_global_memory_bases; + std::map used_global_memory; Tegra::Shader::Header header; }; -- cgit v1.2.3