video_core: Reintroduce dirty flags infrastructure

This commit is contained in:
ReinUsesLisp
2019-12-26 22:14:10 -03:00
parent b92dfcd7f2
commit eed789d0d1
10 changed files with 72 additions and 1 deletions

View File

@ -6,6 +6,7 @@
#include <array>
#include <bitset>
#include <limits>
#include <optional>
#include <type_traits>
#include <unordered_map>
@ -1274,6 +1275,13 @@ public:
return execute_on;
}
/// Notify a memory write has happened.
void OnMemoryWrite() {
for (const u8 store : dirty.on_write_stores) {
dirty.flags[store] = true;
}
}
enum class MMEDrawMode : u32 {
Undefined,
Array,
@ -1289,6 +1297,12 @@ public:
u32 gl_end_count{};
} mme_draw;
struct {
std::bitset<std::numeric_limits<u8>::max()> flags;
std::array<std::array<u8, Regs::NUM_REGS>, 3> tables{};
std::array<u8, 32> on_write_stores{};
} dirty;
private:
void InitializeRegisterDefaults();