mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-05 22:35:38 +00:00
Control SMT
This commit is contained in:
parent
d7ad2f1d71
commit
7dc418a0e0
6 changed files with 259 additions and 32 deletions
|
|
@ -1,5 +1,5 @@
|
|||
using CommonHelpers;
|
||||
using PowerControl.External;
|
||||
using PowerControl.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
|
@ -158,6 +158,33 @@ namespace PowerControl
|
|||
ApplyDelay = 1000,
|
||||
Visible = false
|
||||
},
|
||||
new Menu.MenuItemWithOptions()
|
||||
{
|
||||
Name = "SMT",
|
||||
ApplyDelay = 500,
|
||||
Options = { "No", "Yes" },
|
||||
ResetValue = () => { return "Yes"; },
|
||||
CurrentValue = delegate()
|
||||
{
|
||||
if (!RTSS.IsOSDForeground(out var processId))
|
||||
return null;
|
||||
if (!ProcessorCores.HasSMTThreads())
|
||||
return null;
|
||||
|
||||
return ProcessorCores.IsUsingSMT(processId.Value) ? "Yes" : "No";
|
||||
},
|
||||
ApplyValue = delegate(object selected)
|
||||
{
|
||||
if (!RTSS.IsOSDForeground(out var processId))
|
||||
return null;
|
||||
if (!ProcessorCores.HasSMTThreads())
|
||||
return null;
|
||||
|
||||
ProcessorCores.SetProcessSMT(processId.Value, selected.ToString() == "Yes");
|
||||
|
||||
return ProcessorCores.IsUsingSMT(processId.Value) ? "Yes" : "No";
|
||||
}
|
||||
},
|
||||
new Menu.MenuItemSeparator(),
|
||||
new Menu.MenuItemWithOptions()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue