mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-12 04:08:00 -05:00
shader_ir: Implement STG, keep track of global memory usage and flush
This commit is contained in:
@ -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<GlobalMemoryBase>& GetGlobalMemoryBases() const {
|
||||
return used_global_memory_bases;
|
||||
const std::map<GlobalMemoryBase, GlobalMemoryUsage>& GetGlobalMemory() const {
|
||||
return used_global_memory;
|
||||
}
|
||||
|
||||
std::size_t GetLength() const {
|
||||
@ -781,6 +786,11 @@ private:
|
||||
|
||||
std::pair<Node, s64> TrackRegister(const GprNode* tracked, const NodeBlock& code, s64 cursor);
|
||||
|
||||
std::tuple<Node, Node, GlobalMemoryBase> TrackAndGetGlobalMemory(NodeBlock& bb,
|
||||
Node addr_register,
|
||||
u32 immediate_offset,
|
||||
bool is_write);
|
||||
|
||||
template <typename... T>
|
||||
Node Operation(OperationCode code, const T*... operands) {
|
||||
return StoreNode(OperationNode(code, operands...));
|
||||
@ -834,7 +844,7 @@ private:
|
||||
std::map<u32, ConstBuffer> used_cbufs;
|
||||
std::set<Sampler> used_samplers;
|
||||
std::array<bool, Tegra::Engines::Maxwell3D::Regs::NumClipDistances> used_clip_distances{};
|
||||
std::set<GlobalMemoryBase> used_global_memory_bases;
|
||||
std::map<GlobalMemoryBase, GlobalMemoryUsage> used_global_memory;
|
||||
|
||||
Tegra::Shader::Header header;
|
||||
};
|
||||
|
Reference in New Issue
Block a user