Update GPU Whitelist System (#2178)

* Compile Winutil

* Update Invoke-WinUtilGPU.ps1

* Re-Formate 'Invoke-WinUtilGPU.ps1' Private Function to be Shorter

* Refactor @blueswills changes

* Change Date to allow for easy merge

---------

Co-authored-by: Marterich <Marterich@users.noreply.github.com>
Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: Martin Wiethan <47688561+Marterich@users.noreply.github.com>
This commit is contained in:
Justawildwolf 2024-06-28 14:52:25 +00:00 committed by GitHub
parent 9274c683a2
commit 5b369250b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,29 +1,21 @@
function Invoke-WinUtilGPU {
$gpuInfo = Get-CimInstance Win32_VideoController
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*NVIDIA*") {
return $true # NVIDIA GPU found
}
}
# GPUs to blacklist from using Demanding Theming
$lowPowerGPUs = (
"*NVIDIA GeForce*M*",
"*NVIDIA GeForce*Laptop*",
"*NVIDIA GeForce*GT*",
"*AMD Radeon(TM)*",
"*UHD*"
)
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*AMD Radeon RX*") {
return $true # AMD GPU Found
}
}
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*UHD*") {
return $false # Intel Intergrated GPU Found
}
}
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*AMD Radeon(TM)*") {
return $false # AMD Intergrated GPU Found
foreach ($gpuPattern in $lowPowerGPUs){
if ($gpu.Name -like $gpuPattern) {
return $false
}
}
}
return $true
}