video_core: Make all state dirty after loading a savestate

This commit is contained in:
PabloMK7 2026-01-22 15:43:32 +01:00
parent b0fea112e8
commit 13071868da
4 changed files with 20 additions and 0 deletions

View File

@ -16,6 +16,10 @@ union DirtyRegs {
qwords[reg_id >> 6] |= 1ULL << (reg_id & 0x3f);
}
void SetAllDirty() {
qwords.fill(UINT64_MAX);
}
void Reset() {
qwords.fill(0ULL);
}

View File

@ -35,6 +35,7 @@ PicaCore::PicaCore(Memory::MemorySystem& memory_, std::shared_ptr<DebugContext>
geometry_pipeline{regs.internal, gs_unit, gs_setup},
shader_engine{CreateEngine(Settings::values.use_shader_jit.GetValue())} {
InitializeRegs();
dirty_regs.SetAllDirty();
const auto submit_vertex = [this](const AttributeBuffer& buffer) {
const auto add_triangle = [this](const OutputVertex& v0, const OutputVertex& v1,

View File

@ -185,6 +185,9 @@ public:
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& boost::serialization::make_binary_object(this, sizeof(ProcTex));
if (Archive::is_loading::value) {
table_dirty = TableAllDirty;
}
}
};
@ -225,6 +228,9 @@ public:
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& boost::serialization::make_binary_object(this, sizeof(Lighting));
if (Archive::is_loading::value) {
lut_dirty = LutAllDirty;
}
}
};
@ -253,6 +259,9 @@ public:
template <class Archive>
void serialize(Archive& ar, const u32 file_version) {
ar& boost::serialization::make_binary_object(this, sizeof(Fog));
if (Archive::is_loading::value) {
lut_dirty = true;
}
}
};
@ -285,6 +294,9 @@ private:
ar & geometry_pipeline;
ar & primitive_assembler;
ar & cmd_list;
if (Archive::is_loading::value) {
dirty_regs.SetAllDirty();
}
}
public:

View File

@ -168,6 +168,9 @@ private:
ar & swizzle_data_hash;
ar & requires_fixup;
ar & has_fixup;
if (Archive::is_loading::value) {
uniforms_dirty = true;
}
}
};