Adds method to emit nop instructions to aid in nv2a trace examination.

This commit is contained in:
Erik Abair 2023-07-16 16:25:47 -07:00
parent 46d8ee4d4a
commit 9954f1ee8c
2 changed files with 17 additions and 0 deletions

View File

@ -248,6 +248,20 @@ void TestSuite::Initialize() {
#ifdef ENABLE_PGRAPH_REGION_DIFF
pgraph_diff_.Capture();
#endif
TagNV2ATrace(2);
p = pb_begin();
p = pb_push1(p, NV097_SET_FOG_ENABLE, true);
p = pb_push1(p, NV097_SET_FOG_ENABLE, false);
pb_end(p);
TagNV2ATrace(4);
}
void TestSuite::TagNV2ATrace(uint32_t num_nops) {
ASSERT(num_nops < 32 && "Too many nops in TagNV2ATrace");
auto p = pb_begin();
for (auto i = 0; i < num_nops; ++i) p = pb_push1(p, NV097_NO_OPERATION, 0x00);
pb_end(p);
}
void TestSuite::Deinitialize() {

View File

@ -40,6 +40,9 @@ class TestSuite {
void SetSavingAllowed(bool enable = true) { allow_saving_ = enable; }
void SetSuspectedCrashHandlingMode(SuspectedCrashHandling mode) { suspected_crash_handling_mode_ = mode; }
//! Inserts a pattern of NV097_NO_OPERATION's into the pushbuffer to allow identification when viewing nv2a traces.
static void TagNV2ATrace(uint32_t num_nops);
protected:
void SetDefaultTextureFormat() const;