dolphin/Source/Core/Core/FifoPlayer/FifoPlaybackAnalyzer.h
Pokechu22 d5cfac71d0 Refactor object listing code
This also adds the commands after the last primitive data but before the next frame as a unique object; this is mainly just the XFB copy.  It's nice to have these visible, though disabling the object does nothing since only primitive data is disabled and there is no primitive data in this case.
2021-12-18 12:51:56 -08:00

47 lines
1.0 KiB
C++

// Copyright 2011 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <string>
#include <vector>
#include "Core/FifoPlayer/FifoAnalyzer.h"
#include "Core/FifoPlayer/FifoDataFile.h"
enum class FramePartType
{
Commands,
PrimitiveData,
};
struct FramePart
{
constexpr FramePart(FramePartType type, u32 start, u32 end, const FifoAnalyzer::CPMemory& cpmem)
: m_type(type), m_start(start), m_end(end), m_cpmem(cpmem)
{
}
const FramePartType m_type;
const u32 m_start;
const u32 m_end;
const FifoAnalyzer::CPMemory m_cpmem;
};
struct AnalyzedFrameInfo
{
std::vector<FramePart> parts;
Common::EnumMap<u32, FramePartType::PrimitiveData> part_type_counts;
void AddPart(FramePartType type, u32 start, u32 end, const FifoAnalyzer::CPMemory& cpmem)
{
parts.emplace_back(type, start, end, cpmem);
part_type_counts[type]++;
}
};
namespace FifoPlaybackAnalyzer
{
void AnalyzeFrames(FifoDataFile* file, std::vector<AnalyzedFrameInfo>& frameInfo);
} // namespace FifoPlaybackAnalyzer