Skip to content

Commit 614f397

Browse files
pica: Switch to dirty flags
1 parent 518f723 commit 614f397

File tree

11 files changed

+158
-482
lines changed

11 files changed

+158
-482
lines changed

Diff for: src/video_core/debug_utils/debug_utils.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,10 @@ void StartPicaTracing() {
272272
}
273273

274274
void OnPicaRegWrite(u16 cmd_id, u16 mask, u32 value) {
275-
std::lock_guard lock(pica_trace_mutex);
276-
277275
if (!g_is_pica_tracing)
278276
return;
279277

278+
std::lock_guard lock(pica_trace_mutex);
280279
pica_trace->writes.push_back(PicaTrace::Write{cmd_id, mask, value});
281280
}
282281

Diff for: src/video_core/pica/pica_core.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,9 @@ void PicaCore::WriteInternalReg(u32 id, u32 value, u32 mask) {
412412
break;
413413
}
414414

415-
// Notify the rasterizer an internal register was updated.
416-
rasterizer->NotifyPicaRegisterChanged(id);
415+
// Mark register as dirty
416+
dirty_flags.set(id);
417+
LOG_INFO(HW_GPU, "Setting dirty flag for reg = {:#x}", id);
417418
}
418419

419420
void PicaCore::SubmitImmediate(u32 value) {

Diff for: src/video_core/pica/pica_core.h

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#pragma once
66

7+
#include <bitset>
78
#include "core/hle/service/gsp/gsp_interrupt.h"
89
#include "video_core/pica/geometry_pipeline.h"
910
#include "video_core/pica/packed_attribute.h"
@@ -240,8 +241,11 @@ class PicaCore {
240241
}
241242
};
242243

244+
using DirtyFlags = std::bitset<Regs::NUM_REGS>;
245+
243246
RegsLcd regs_lcd{};
244247
Regs regs{};
248+
DirtyFlags dirty_flags{};
245249
// TODO: Move these to a separate shader scheduler class
246250
GeometryShaderUnit gs_unit;
247251
ShaderSetup vs_setup;

0 commit comments

Comments
 (0)