mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 05:53:40 +00:00
[host] removed MTMemcpy, overheads negate performance gains
This commit is contained in:
parent
5899508a5b
commit
fcf0976081
@ -163,12 +163,6 @@ bool DXGI::Initialize()
|
||||
DeInitialize();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_memcpy.Initialize())
|
||||
{
|
||||
DEBUG_ERROR("Failed to initialize memcpy");
|
||||
return false;
|
||||
}
|
||||
|
||||
m_initialized = true;
|
||||
return true;
|
||||
@ -176,8 +170,6 @@ bool DXGI::Initialize()
|
||||
|
||||
void DXGI::DeInitialize()
|
||||
{
|
||||
m_memcpy.DeInitialize();
|
||||
|
||||
if (m_pointer)
|
||||
{
|
||||
delete[] m_pointer;
|
||||
@ -358,7 +350,7 @@ bool DXGI::GrabFrame(FrameInfo & frame)
|
||||
frame.stride = rect.Pitch / 4;
|
||||
|
||||
frame.outSize = min(frame.bufferSize, m_height * rect.Pitch);
|
||||
m_memcpy.Copy(frame.buffer, rect.pBits, frame.outSize);
|
||||
memcpy_s(frame.buffer, frame.bufferSize, rect.pBits, frame.outSize);
|
||||
status = surface->Unmap();
|
||||
|
||||
// if we have a mouse update
|
||||
|
@ -19,7 +19,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#pragma once
|
||||
|
||||
#include "ICapture.h"
|
||||
#include "MTMemcpy.h"
|
||||
|
||||
#define W32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
@ -45,7 +44,6 @@ namespace Capture
|
||||
bool ReInitialize();
|
||||
|
||||
bool m_initialized;
|
||||
MTMemcpy m_memcpy;
|
||||
unsigned int m_width;
|
||||
unsigned int m_height;
|
||||
|
||||
|
@ -150,21 +150,12 @@ bool NvFBC::Initialize()
|
||||
m_grabFrameParams.eGMode = NVFBC_TOSYS_SOURCEMODE_SCALE;
|
||||
m_grabFrameParams.pNvFBCFrameGrabInfo = &m_grabInfo;
|
||||
|
||||
if (!m_memcpy.Initialize())
|
||||
{
|
||||
DEBUG_ERROR("Failed to initialize MTMemcpy");
|
||||
DeInitialize();
|
||||
return false;
|
||||
}
|
||||
|
||||
m_initialized = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void NvFBC::DeInitialize()
|
||||
{
|
||||
m_memcpy.DeInitialize();
|
||||
|
||||
m_frameBuffer = NULL;
|
||||
|
||||
if (m_nvFBC)
|
||||
@ -233,11 +224,7 @@ bool NvFBC::GrabFrame(struct FrameInfo & frame)
|
||||
frame.height = m_grabInfo.dwHeight;
|
||||
frame.stride = m_grabInfo.dwBufferWidth;
|
||||
frame.outSize = m_grabInfo.dwBufferWidth * m_grabInfo.dwHeight * 3;
|
||||
if (!m_memcpy.Copy(frame.buffer, m_frameBuffer, frame.outSize))
|
||||
{
|
||||
DEBUG_ERROR("Memory copy failed");
|
||||
return false;
|
||||
}
|
||||
memcpy_s(frame.buffer, frame.bufferSize, m_frameBuffer, frame.outSize);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
#include "ICapture.h"
|
||||
#include "MTMemcpy.h"
|
||||
|
||||
#define W32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
@ -44,7 +43,6 @@ namespace Capture
|
||||
private:
|
||||
bool m_initialized;
|
||||
HMODULE m_hDLL;
|
||||
MTMemcpy m_memcpy;
|
||||
|
||||
NvFBC_CreateFunctionExType m_fnCreateEx;
|
||||
NvFBC_SetGlobalFlagsType m_fnSetGlobalFlags;
|
||||
|
Loading…
Reference in New Issue
Block a user