VideoCommon/OpcodeDecoding: Move g_bRecordFifoData into namespace
Keeps the global localized with the code that it's primarily related to. Now it's obvious from a glance what the global variable is affecting.
This commit is contained in:
parent
d8063e9c54
commit
b2a9c36501
|
@ -25,6 +25,7 @@
|
||||||
#include "VideoCommon/Fifo.h"
|
#include "VideoCommon/Fifo.h"
|
||||||
#include "VideoCommon/FramebufferManager.h"
|
#include "VideoCommon/FramebufferManager.h"
|
||||||
#include "VideoCommon/GeometryShaderManager.h"
|
#include "VideoCommon/GeometryShaderManager.h"
|
||||||
|
#include "VideoCommon/OpcodeDecoding.h"
|
||||||
#include "VideoCommon/PerfQueryBase.h"
|
#include "VideoCommon/PerfQueryBase.h"
|
||||||
#include "VideoCommon/PixelEngine.h"
|
#include "VideoCommon/PixelEngine.h"
|
||||||
#include "VideoCommon/PixelShaderManager.h"
|
#include "VideoCommon/PixelShaderManager.h"
|
||||||
|
@ -343,7 +344,7 @@ static void BPWritten(const BPCmd& bp)
|
||||||
|
|
||||||
Memory::CopyFromEmu(texMem + tlutTMemAddr, addr, tlutXferCount);
|
Memory::CopyFromEmu(texMem + tlutTMemAddr, addr, tlutXferCount);
|
||||||
|
|
||||||
if (g_bRecordFifoData)
|
if (OpcodeDecoder::g_record_fifo_data)
|
||||||
FifoRecorder::GetInstance().UseMemory(addr, tlutXferCount, MemoryUpdate::TMEM);
|
FifoRecorder::GetInstance().UseMemory(addr, tlutXferCount, MemoryUpdate::TMEM);
|
||||||
|
|
||||||
TextureCacheBase::InvalidateAllBindPoints();
|
TextureCacheBase::InvalidateAllBindPoints();
|
||||||
|
@ -566,7 +567,7 @@ static void BPWritten(const BPCmd& bp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_bRecordFifoData)
|
if (OpcodeDecoder::g_record_fifo_data)
|
||||||
FifoRecorder::GetInstance().UseMemory(src_addr, bytes_read, MemoryUpdate::TMEM);
|
FifoRecorder::GetInstance().UseMemory(src_addr, bytes_read, MemoryUpdate::TMEM);
|
||||||
|
|
||||||
TextureCacheBase::InvalidateAllBindPoints();
|
TextureCacheBase::InvalidateAllBindPoints();
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include "VideoCommon/VideoCommon.h"
|
#include "VideoCommon/VideoCommon.h"
|
||||||
#include "VideoCommon/XFMemory.h"
|
#include "VideoCommon/XFMemory.h"
|
||||||
|
|
||||||
bool g_bRecordFifoData = false;
|
|
||||||
|
|
||||||
namespace OpcodeDecoder
|
namespace OpcodeDecoder
|
||||||
{
|
{
|
||||||
static bool s_is_fifo_error_seen = false;
|
static bool s_is_fifo_error_seen = false;
|
||||||
|
@ -75,6 +73,8 @@ static void InterpretDisplayListPreprocess(u32 address, u32 size)
|
||||||
Run<true>(DataReader(start_address, start_address + size), nullptr, true);
|
Run<true>(DataReader(start_address, start_address + size), nullptr, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool g_record_fifo_data = false;
|
||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
s_is_fifo_error_seen = false;
|
s_is_fifo_error_seen = false;
|
||||||
|
@ -255,7 +255,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display lists get added directly into the FIFO stream
|
// Display lists get added directly into the FIFO stream
|
||||||
if (!is_preprocess && g_bRecordFifoData && cmd_byte != GX_CMD_CALL_DL)
|
if (!is_preprocess && g_record_fifo_data && cmd_byte != GX_CMD_CALL_DL)
|
||||||
{
|
{
|
||||||
const u8* const opcode_end = src.GetPointer();
|
const u8* const opcode_end = src.GetPointer();
|
||||||
FifoRecorder::GetInstance().WriteGPCommand(opcode_start, u32(opcode_end - opcode_start));
|
FifoRecorder::GetInstance().WriteGPCommand(opcode_start, u32(opcode_end - opcode_start));
|
||||||
|
|
|
@ -10,6 +10,9 @@ class DataReader;
|
||||||
|
|
||||||
namespace OpcodeDecoder
|
namespace OpcodeDecoder
|
||||||
{
|
{
|
||||||
|
// Global flag to signal if FifoRecorder is active.
|
||||||
|
extern bool g_record_fifo_data;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
GX_NOP = 0x00,
|
GX_NOP = 0x00,
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
#include "VideoCommon/NetPlayChatUI.h"
|
#include "VideoCommon/NetPlayChatUI.h"
|
||||||
#include "VideoCommon/NetPlayGolfUI.h"
|
#include "VideoCommon/NetPlayGolfUI.h"
|
||||||
#include "VideoCommon/OnScreenDisplay.h"
|
#include "VideoCommon/OnScreenDisplay.h"
|
||||||
|
#include "VideoCommon/OpcodeDecoding.h"
|
||||||
#include "VideoCommon/PixelEngine.h"
|
#include "VideoCommon/PixelEngine.h"
|
||||||
#include "VideoCommon/PixelShaderManager.h"
|
#include "VideoCommon/PixelShaderManager.h"
|
||||||
#include "VideoCommon/PostProcessing.h"
|
#include "VideoCommon/PostProcessing.h"
|
||||||
|
@ -880,19 +881,18 @@ std::tuple<int, int> Renderer::CalculateOutputDimensions(int width, int height)
|
||||||
|
|
||||||
void Renderer::CheckFifoRecording()
|
void Renderer::CheckFifoRecording()
|
||||||
{
|
{
|
||||||
bool wasRecording = g_bRecordFifoData;
|
const bool was_recording = OpcodeDecoder::g_record_fifo_data;
|
||||||
g_bRecordFifoData = FifoRecorder::GetInstance().IsRecording();
|
OpcodeDecoder::g_record_fifo_data = FifoRecorder::GetInstance().IsRecording();
|
||||||
|
|
||||||
if (g_bRecordFifoData)
|
if (!OpcodeDecoder::g_record_fifo_data)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!was_recording)
|
||||||
{
|
{
|
||||||
if (!wasRecording)
|
RecordVideoMemory();
|
||||||
{
|
|
||||||
RecordVideoMemory();
|
|
||||||
}
|
|
||||||
|
|
||||||
FifoRecorder::GetInstance().EndFrame(CommandProcessor::fifo.CPBase,
|
|
||||||
CommandProcessor::fifo.CPEnd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FifoRecorder::GetInstance().EndFrame(CommandProcessor::fifo.CPBase, CommandProcessor::fifo.CPEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::RecordVideoMemory()
|
void Renderer::RecordVideoMemory()
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "VideoCommon/BPMemory.h"
|
#include "VideoCommon/BPMemory.h"
|
||||||
#include "VideoCommon/FramebufferManager.h"
|
#include "VideoCommon/FramebufferManager.h"
|
||||||
#include "VideoCommon/HiresTextures.h"
|
#include "VideoCommon/HiresTextures.h"
|
||||||
|
#include "VideoCommon/OpcodeDecoding.h"
|
||||||
#include "VideoCommon/PixelShaderManager.h"
|
#include "VideoCommon/PixelShaderManager.h"
|
||||||
#include "VideoCommon/RenderBase.h"
|
#include "VideoCommon/RenderBase.h"
|
||||||
#include "VideoCommon/SamplerCommon.h"
|
#include "VideoCommon/SamplerCommon.h"
|
||||||
|
@ -1260,9 +1261,11 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
|
||||||
|
|
||||||
// If we are recording a FifoLog, keep track of what memory we read. FifoRecorder does
|
// If we are recording a FifoLog, keep track of what memory we read. FifoRecorder does
|
||||||
// its own memory modification tracking independent of the texture hashing below.
|
// its own memory modification tracking independent of the texture hashing below.
|
||||||
if (g_bRecordFifoData && !from_tmem)
|
if (OpcodeDecoder::g_record_fifo_data && !from_tmem)
|
||||||
|
{
|
||||||
FifoRecorder::GetInstance().UseMemory(address, texture_size + additional_mips_size,
|
FifoRecorder::GetInstance().UseMemory(address, texture_size + additional_mips_size,
|
||||||
MemoryUpdate::TEXTURE_MAP);
|
MemoryUpdate::TEXTURE_MAP);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This doesn't hash GB tiles for preloaded RGBA8 textures (instead, it's hashing more data
|
// TODO: This doesn't hash GB tiles for preloaded RGBA8 textures (instead, it's hashing more data
|
||||||
// from the low tmem bank than it should)
|
// from the low tmem bank than it should)
|
||||||
|
@ -2294,7 +2297,7 @@ void TextureCacheBase::CopyRenderTargetToTexture(
|
||||||
++iter.first;
|
++iter.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_bRecordFifoData)
|
if (OpcodeDecoder::g_record_fifo_data)
|
||||||
{
|
{
|
||||||
// Mark the memory behind this efb copy as dynamicly generated for the Fifo log
|
// Mark the memory behind this efb copy as dynamicly generated for the Fifo log
|
||||||
u32 address = dstAddr;
|
u32 address = dstAddr;
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
// Global flag to signal if FifoRecorder is active.
|
|
||||||
extern bool g_bRecordFifoData;
|
|
||||||
|
|
||||||
// These are accurate (disregarding AA modes).
|
// These are accurate (disregarding AA modes).
|
||||||
constexpr u32 EFB_WIDTH = 640;
|
constexpr u32 EFB_WIDTH = 640;
|
||||||
constexpr u32 EFB_HEIGHT = 528;
|
constexpr u32 EFB_HEIGHT = 528;
|
||||||
|
|
Loading…
Reference in New Issue