[host] dxgi: d3d12 now writes direclty into ivshmem

This is still incomplete as d3d12 doesn't have any proper sync with the
captured frame and as such is still not suggested for general usage. This
change though is monumental for this project as it removes a full memory
copy reducing bandwidth consumption enormously.
This commit is contained in:
Geoffrey McRae
2024-01-27 17:55:44 +11:00
parent adaf40e2bf
commit 34e8a2255e
10 changed files with 18754 additions and 8144 deletions

View File

@@ -185,8 +185,9 @@ static void nvfbc_initOptions(void)
}
static bool nvfbc_create(
CaptureGetPointerBuffer getPointerBufferFn,
CapturePostPointerBuffer postPointerBufferFn)
void * ivshmemBase,
CaptureGetPointerBuffer getPointerBufferFn,
CapturePostPointerBuffer postPointerBufferFn)
{
if (!NvFBCInit())
return false;
@@ -220,7 +221,7 @@ static void updateScale(void)
this->targetHeight = this->height;
}
static bool nvfbc_init(void)
static bool nvfbc_init(unsigned * alignSize)
{
int adapterIndex = option_get_int("nvfbc", "adapterIndex");
@@ -447,7 +448,8 @@ static void nvfbc_free(void)
NvFBCFree();
}
static CaptureResult nvfbc_capture(void)
static CaptureResult nvfbc_capture(unsigned frameBufferIndex,
FrameBuffer * frameBuffer)
{
// this is a bit of a hack as it causes this thread to block until the next
// present keeping us locked with the refresh rate of the monitor being