|
@@ -281,9 +281,11 @@ void gs_device::InitDevice(uint32_t adapterIdx)
|
|
/* check for nv12 texture output support */
|
|
/* check for nv12 texture output support */
|
|
|
|
|
|
nv12Supported = false;
|
|
nv12Supported = false;
|
|
|
|
+ bool geforce = astrstri(adapterNameUTF8, "geforce") != nullptr;
|
|
|
|
+ bool nvidia = astrstri(adapterNameUTF8, "nvidia") != nullptr;
|
|
|
|
|
|
/* don't use on blacklisted adapters */
|
|
/* don't use on blacklisted adapters */
|
|
- if (astrstri(adapterNameUTF8, "geforce") != nullptr) {
|
|
|
|
|
|
+ if (geforce) {
|
|
for (const char *old_gpu : blacklisted_nv12_geforce_gpus) {
|
|
for (const char *old_gpu : blacklisted_nv12_geforce_gpus) {
|
|
if (astrstri(adapterNameUTF8, old_gpu) != nullptr) {
|
|
if (astrstri(adapterNameUTF8, old_gpu) != nullptr) {
|
|
return;
|
|
return;
|
|
@@ -291,6 +293,17 @@ void gs_device::InitDevice(uint32_t adapterIdx)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* Disable NV12 textures if NVENC not available, just as a safety
|
|
|
|
+ * measure */
|
|
|
|
+ if (nvidia) {
|
|
|
|
+ HMODULE nvenc = LoadLibraryW((sizeof(void*) == 8)
|
|
|
|
+ ? L"nvEncodeAPI64.dll"
|
|
|
|
+ : L"nvEncodeAPI.dll");
|
|
|
|
+ if (!nvenc) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
ComQIPtr<ID3D11Device1> d3d11_1(device);
|
|
ComQIPtr<ID3D11Device1> d3d11_1(device);
|
|
if (!d3d11_1) {
|
|
if (!d3d11_1) {
|
|
return;
|
|
return;
|