mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
feat(ddprobe): allow to manually specify gpu preference (#3521)
Some checks failed
CI / GitHub Env Debug (push) Has been cancelled
CI / Setup Release (push) Has been cancelled
CI / Setup Flatpak Matrix (push) Has been cancelled
CI Docker / Check Dockerfiles (push) Has been cancelled
CodeQL / Get language matrix (push) Has been cancelled
localize / Update Localization (push) Has been cancelled
Build GH-Pages / prep (push) Has been cancelled
CI / Linux Flatpak (push) Has been cancelled
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Has been cancelled
CI / Windows (push) Has been cancelled
CI Docker / Setup Release (push) Has been cancelled
CI Docker / Docker${{ matrix.tag }} (push) Has been cancelled
CodeQL / Analyze (${{ matrix.name }}) (push) Has been cancelled
Build GH-Pages / call-jekyll-build (push) Has been cancelled
Some checks failed
CI / GitHub Env Debug (push) Has been cancelled
CI / Setup Release (push) Has been cancelled
CI / Setup Flatpak Matrix (push) Has been cancelled
CI Docker / Check Dockerfiles (push) Has been cancelled
CodeQL / Get language matrix (push) Has been cancelled
localize / Update Localization (push) Has been cancelled
Build GH-Pages / prep (push) Has been cancelled
CI / Linux Flatpak (push) Has been cancelled
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Has been cancelled
CI / Windows (push) Has been cancelled
CI Docker / Setup Release (push) Has been cancelled
CI Docker / Docker${{ matrix.tag }} (push) Has been cancelled
CodeQL / Analyze (${{ matrix.name }}) (push) Has been cancelled
Build GH-Pages / call-jekyll-build (push) Has been cancelled
This commit is contained in:
@@ -386,12 +386,7 @@ namespace platf::dxgi {
|
||||
// would have been raised first if it wasn't.
|
||||
if (result == S_OK || result == E_ACCESSDENIED) {
|
||||
// We found a working GPU preference, so set ourselves to use that.
|
||||
if (set_gpu_preference_on_self(i)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
return set_gpu_preference_on_self(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,16 +413,25 @@ namespace platf::dxgi {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Try probing with different GPU preferences and verify_frame_capture flag
|
||||
if (validate_and_test_gpu_preference(display_name, true)) {
|
||||
set_gpu_preference = true;
|
||||
return true;
|
||||
// If the GPU preference was manually specified, we can skip the probe.
|
||||
if (config::video.gpu_preference >= 0) {
|
||||
if (set_gpu_preference_on_self(config::video.gpu_preference)) {
|
||||
set_gpu_preference = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Try probing with different GPU preferences and verify_frame_capture flag
|
||||
if (validate_and_test_gpu_preference(display_name, true)) {
|
||||
set_gpu_preference = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// If no valid configuration was found, try again with verify_frame_capture == false
|
||||
if (validate_and_test_gpu_preference(display_name, false)) {
|
||||
set_gpu_preference = true;
|
||||
return true;
|
||||
// If no valid configuration was found, try again with verify_frame_capture == false
|
||||
if (validate_and_test_gpu_preference(display_name, false)) {
|
||||
set_gpu_preference = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// If neither worked, return false
|
||||
|
||||
Reference in New Issue
Block a user