[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 2021-06-06 06:14:24 +10:00
parent 1d7eb50608
commit fcf6abc7c6
2 changed files with 8 additions and 4 deletions

View File

@ -17,14 +17,14 @@ if(NOT EXISTS "${nvfbc_sdk}/inc" OR NOT IS_DIRECTORY "${nvfbc_sdk}/inc")
set(USE_NVFBC OFF) set(USE_NVFBC OFF)
endif() endif()
if(USE_NVFBC)
add_capture("NVFBC")
endif()
if(USE_DXGI) if(USE_DXGI)
add_capture("DXGI") add_capture("DXGI")
endif() endif()
if(USE_NVFBC)
add_capture("NVFBC")
endif()
include("PostCapture") include("PostCapture")
add_library(capture STATIC ${CAPTURE_C}) add_library(capture STATIC ${CAPTURE_C})

View File

@ -165,6 +165,10 @@ static bool nvfbc_init(void)
free(buffer); 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)) if (!NvFBCToSysCreate(privData, privDataLen, &this->nvfbc, &this->maxWidth, &this->maxHeight))
{ {
free(privData); free(privData);