mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Remove Frameskip
This commit is contained in:
@ -192,40 +192,32 @@ void CopyTempBuffer(s16 x, s16 y, int bufferBase, int subBuffer, const char* nam
|
||||
|
||||
void OnObjectBegin()
|
||||
{
|
||||
if (!Fifo::WillSkipCurrentFrame())
|
||||
{
|
||||
if (g_ActiveConfig.bDumpTextures &&
|
||||
stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart &&
|
||||
stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd)
|
||||
DumpActiveTextures();
|
||||
}
|
||||
if (g_ActiveConfig.bDumpTextures && stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart &&
|
||||
stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd)
|
||||
DumpActiveTextures();
|
||||
}
|
||||
|
||||
void OnObjectEnd()
|
||||
{
|
||||
if (!Fifo::WillSkipCurrentFrame())
|
||||
if (g_ActiveConfig.bDumpObjects && stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart &&
|
||||
stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd)
|
||||
DumpEfb(StringFromFormat("%sobject%i.png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(),
|
||||
stats.thisFrame.numDrawnObjects));
|
||||
|
||||
for (int i = 0; i < NUM_OBJECT_BUFFERS; i++)
|
||||
{
|
||||
if (g_ActiveConfig.bDumpObjects &&
|
||||
stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart &&
|
||||
stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd)
|
||||
DumpEfb(StringFromFormat("%sobject%i.png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(),
|
||||
stats.thisFrame.numDrawnObjects));
|
||||
|
||||
for (int i = 0; i < NUM_OBJECT_BUFFERS; i++)
|
||||
if (DrawnToBuffer[i])
|
||||
{
|
||||
if (DrawnToBuffer[i])
|
||||
{
|
||||
DrawnToBuffer[i] = false;
|
||||
std::string filename = StringFromFormat(
|
||||
"%sobject%i_%s(%i).png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(),
|
||||
stats.thisFrame.numDrawnObjects, ObjectBufferName[i], i - BufferBase[i]);
|
||||
DrawnToBuffer[i] = false;
|
||||
std::string filename =
|
||||
StringFromFormat("%sobject%i_%s(%i).png", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(),
|
||||
stats.thisFrame.numDrawnObjects, ObjectBufferName[i], i - BufferBase[i]);
|
||||
|
||||
TextureToPng((u8*)ObjectBuffer[i], EFB_WIDTH * 4, filename, EFB_WIDTH, EFB_HEIGHT, true);
|
||||
memset(ObjectBuffer[i], 0, EFB_WIDTH * EFB_HEIGHT * sizeof(u32));
|
||||
}
|
||||
TextureToPng((u8*)ObjectBuffer[i], EFB_WIDTH * 4, filename, EFB_WIDTH, EFB_HEIGHT, true);
|
||||
memset(ObjectBuffer[i], 0, EFB_WIDTH * EFB_HEIGHT * sizeof(u32));
|
||||
}
|
||||
|
||||
stats.thisFrame.numDrawnObjects++;
|
||||
}
|
||||
|
||||
stats.thisFrame.numDrawnObjects++;
|
||||
}
|
||||
}
|
||||
|
@ -67,34 +67,31 @@ void CopyEfb()
|
||||
rc.right = rc.left + (int)bpmem.copyTexSrcWH.x + 1;
|
||||
rc.bottom = rc.top + (int)bpmem.copyTexSrcWH.y + 1;
|
||||
|
||||
if (!Fifo::WillSkipCurrentFrame())
|
||||
if (bpmem.triggerEFBCopy.copy_to_xfb)
|
||||
{
|
||||
if (bpmem.triggerEFBCopy.copy_to_xfb)
|
||||
{
|
||||
float yScale;
|
||||
if (bpmem.triggerEFBCopy.scale_invert)
|
||||
yScale = 256.0f / (float)bpmem.dispcopyyscale;
|
||||
else
|
||||
yScale = (float)bpmem.dispcopyyscale / 256.0f;
|
||||
|
||||
float xfbLines = ((bpmem.copyTexSrcWH.y + 1.0f) * yScale);
|
||||
|
||||
if (yScale != 1.0)
|
||||
WARN_LOG(VIDEO, "yScale of %f is currently unsupported", yScale);
|
||||
|
||||
if ((u32)xfbLines > MAX_XFB_HEIGHT)
|
||||
{
|
||||
INFO_LOG(VIDEO, "Tried to scale EFB to too many XFB lines (%f)", xfbLines);
|
||||
xfbLines = MAX_XFB_HEIGHT;
|
||||
}
|
||||
|
||||
CopyToXfb(bpmem.copyTexDest << 5, bpmem.copyMipMapStrideChannels << 4, (u32)xfbLines, rc,
|
||||
s_gammaLUT[bpmem.triggerEFBCopy.gamma]);
|
||||
}
|
||||
float yScale;
|
||||
if (bpmem.triggerEFBCopy.scale_invert)
|
||||
yScale = 256.0f / (float)bpmem.dispcopyyscale;
|
||||
else
|
||||
yScale = (float)bpmem.dispcopyyscale / 256.0f;
|
||||
|
||||
float xfbLines = ((bpmem.copyTexSrcWH.y + 1.0f) * yScale);
|
||||
|
||||
if (yScale != 1.0)
|
||||
WARN_LOG(VIDEO, "yScale of %f is currently unsupported", yScale);
|
||||
|
||||
if ((u32)xfbLines > MAX_XFB_HEIGHT)
|
||||
{
|
||||
CopyToRam(); // FIXME: should use the rectangle we have already created above
|
||||
INFO_LOG(VIDEO, "Tried to scale EFB to too many XFB lines (%f)", xfbLines);
|
||||
xfbLines = MAX_XFB_HEIGHT;
|
||||
}
|
||||
|
||||
CopyToXfb(bpmem.copyTexDest << 5, bpmem.copyMipMapStrideChannels << 4, (u32)xfbLines, rc,
|
||||
s_gammaLUT[bpmem.triggerEFBCopy.gamma]);
|
||||
}
|
||||
else
|
||||
{
|
||||
CopyToRam(); // FIXME: should use the rectangle we have already created above
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -112,42 +112,39 @@ void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed* xfb, u32 fbWidt
|
||||
void SWRenderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight,
|
||||
const EFBRectangle& rc, float Gamma)
|
||||
{
|
||||
if (!Fifo::WillSkipCurrentFrame())
|
||||
if (g_ActiveConfig.bUseXFB)
|
||||
{
|
||||
if (g_ActiveConfig.bUseXFB)
|
||||
{
|
||||
EfbInterface::yuv422_packed* xfb = (EfbInterface::yuv422_packed*)Memory::GetPointer(xfbAddr);
|
||||
UpdateColorTexture(xfb, fbWidth, fbHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
EfbInterface::BypassXFB(GetCurrentColorTexture(), fbWidth, fbHeight, rc, Gamma);
|
||||
}
|
||||
EfbInterface::yuv422_packed* xfb = (EfbInterface::yuv422_packed*)Memory::GetPointer(xfbAddr);
|
||||
UpdateColorTexture(xfb, fbWidth, fbHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
EfbInterface::BypassXFB(GetCurrentColorTexture(), fbWidth, fbHeight, rc, Gamma);
|
||||
}
|
||||
|
||||
// Save screenshot
|
||||
if (s_bScreenshot)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(s_criticalScreenshot);
|
||||
// Save screenshot
|
||||
if (s_bScreenshot)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(s_criticalScreenshot);
|
||||
|
||||
if (TextureToPng(GetCurrentColorTexture(), fbWidth * 4, s_sScreenshotName, fbWidth, fbHeight,
|
||||
false))
|
||||
OSD::AddMessage("Screenshot saved to " + s_sScreenshotName);
|
||||
if (TextureToPng(GetCurrentColorTexture(), fbWidth * 4, s_sScreenshotName, fbWidth, fbHeight,
|
||||
false))
|
||||
OSD::AddMessage("Screenshot saved to " + s_sScreenshotName);
|
||||
|
||||
// Reset settings
|
||||
s_sScreenshotName.clear();
|
||||
s_bScreenshot = false;
|
||||
s_screenshotCompleted.Set();
|
||||
}
|
||||
// Reset settings
|
||||
s_sScreenshotName.clear();
|
||||
s_bScreenshot = false;
|
||||
s_screenshotCompleted.Set();
|
||||
}
|
||||
|
||||
if (SConfig::GetInstance().m_DumpFrames)
|
||||
{
|
||||
static int frame_index = 0;
|
||||
TextureToPng(GetCurrentColorTexture(), fbWidth * 4,
|
||||
StringFromFormat("%sframe%i_color.png",
|
||||
File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), frame_index),
|
||||
fbWidth, fbHeight, true);
|
||||
frame_index++;
|
||||
}
|
||||
if (SConfig::GetInstance().m_DumpFrames)
|
||||
{
|
||||
static int frame_index = 0;
|
||||
TextureToPng(GetCurrentColorTexture(), fbWidth * 4,
|
||||
StringFromFormat("%sframe%i_color.png",
|
||||
File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), frame_index),
|
||||
fbWidth, fbHeight, true);
|
||||
frame_index++;
|
||||
}
|
||||
|
||||
OSD::DoCallbacks(OSD::CallbackType::OnFrame);
|
||||
|
Reference in New Issue
Block a user