Skip to content

Commit 964d1b8

Browse files
pica: Switch to dirty flags
1 parent 518f723 commit 964d1b8

File tree

11 files changed

+166
-483
lines changed

11 files changed

+166
-483
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-3
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ void PicaCore::WriteInternalReg(u32 id, u32 value, u32 mask) {
362362

363363
lighting.luts[lut_config.type][lut_config.index].raw = value;
364364
lut_config.index.Assign(lut_config.index + 1);
365+
rasterizer->MarkLightLutDirty();
365366
break;
366367
}
367368

@@ -387,7 +388,6 @@ void PicaCore::WriteInternalReg(u32 id, u32 value, u32 mask) {
387388
case PICA_REG_INDEX(texturing.proctex_lut_data[6]):
388389
case PICA_REG_INDEX(texturing.proctex_lut_data[7]): {
389390
auto& index = regs.internal.texturing.proctex_lut_config.index;
390-
391391
switch (regs.internal.texturing.proctex_lut_config.ref_table.Value()) {
392392
case TexturingRegs::ProcTexLutTable::Noise:
393393
proctex.noise_table[index % proctex.noise_table.size()].raw = value;
@@ -412,8 +412,8 @@ 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);
417417
}
418418

419419
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<RegsInternal::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)