[host] NvFBC/DXGI: make DXGI the default instead of the fallback

It has been detemined that a failure to init NvFBC causes a 20-30%
performance penalty on non NvFBC supported hardware (GeForce) when using
DXGI, as such reverse the order and default to using DXGI as our first
option.

If NvFBC is still desired, pr #500 added the option `app:capture` which
can be used to force NvFBC.
This commit is contained in:
Geoffrey McRae committed 2021-06-06 06:14:24 +10:00
1 parent 1d7eb50608
commit fcf6abc7c6
2 files changed
+8 -4

No files matched your search

+4 -4
View File
@@ -17,14 +17,14 @@ if(NOT EXISTS "${nvfbc_sdk}/inc" OR NOT IS_DIRECTORY "${nvfbc_sdk}/inc")
set(USE_NVFBC OFF)
endif()
if(USE_NVFBC)
add_capture("NVFBC")
endif()
if(USE_DXGI)
add_capture("DXGI")
endif()
if(USE_NVFBC)
add_capture("NVFBC")
endif()
include("PostCapture")
add_library(capture STATIC ${CAPTURE_C})
@@ -165,6 +165,10 @@ static bool nvfbc_init(void)
free(buffer);
}
// NOTE: Calling this on hardware that doesn't support NvFBC such as GeForce
// causes a substantial performance pentalty even if it fails! As such we only
// attempt NvFBC as a last resort, or if configured via the app:capture
// option.
if (!NvFBCToSysCreate(privData, privDataLen, &this->nvfbc, &this->maxWidth, &this->maxHeight))
{
free(privData);