summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2016-10-11 22:25:28 +0200
committerGitHub <noreply@github.com>2016-10-11 22:25:28 +0200
commit7d5363ffa8228dce2a606ca542a997ce06aa7be0 (patch)
treed347e0b81a18d6dabf202f76b26025f5b1079e38 /Source/Core/VideoCommon/RenderBase.cpp
parent4e46be951a3872b03352c82e4aa3def27de4f124 (diff)
parent9f264c0872603ba1963adfa706ca7a1490bd0a24 (diff)
Merge pull request #4337 from degasus/framedump
AVIDump: Move CoreTiming into caller.
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 9a81fa5e4d..d0bf77e0db 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -28,6 +28,7 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
+#include "Core/CoreTiming.h"
#include "Core/FifoPlayer/FifoRecorder.h"
#include "Core/HW/VideoInterface.h"
#include "Core/Host.h"
@@ -138,8 +139,11 @@ void Renderer::RenderToXFB(u32 xfbAddr, const EFBRectangle& sourceRc, u32 fbStri
}
else
{
+ // The timing is not predictable here. So try to use the XFB path to dump frames.
+ u64 ticks = CoreTiming::GetTicks();
+
// below div two to convert from bytes to pixels - it expects width, not stride
- Swap(xfbAddr, fbStride / 2, fbStride / 2, fbHeight, sourceRc, Gamma);
+ Swap(xfbAddr, fbStride / 2, fbStride / 2, fbHeight, sourceRc, ticks, Gamma);
}
}
@@ -516,10 +520,10 @@ void Renderer::RecordVideoMemory()
}
void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc,
- float Gamma)
+ u64 ticks, float Gamma)
{
// TODO: merge more generic parts into VideoCommon
- g_renderer->SwapImpl(xfbAddr, fbWidth, fbStride, fbHeight, rc, Gamma);
+ g_renderer->SwapImpl(xfbAddr, fbWidth, fbStride, fbHeight, rc, ticks, Gamma);
if (XFBWrited)
g_renderer->m_fps_counter.Update();
@@ -558,7 +562,8 @@ bool Renderer::IsFrameDumping()
return false;
}
-void Renderer::DumpFrameData(const u8* data, int w, int h, int stride, bool swap_upside_down)
+void Renderer::DumpFrameData(const u8* data, int w, int h, int stride, u64 ticks,
+ bool swap_upside_down)
{
if (w == 0 || h == 0)
return;
@@ -601,7 +606,7 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, int stride, bool swap
}
if (m_AVI_dumping)
{
- AVIDump::AddFrame(m_frame_data.data(), w, h, stride);
+ AVIDump::AddFrame(m_frame_data.data(), w, h, stride, ticks);
}
m_last_frame_dumped = true;