Fixup Win10 CPU Sets to check the EfficiencyClass
Instead of picking the first physical core for Xbox threads, Cxbx-R now picks the first highest performance physical core. While at least Alder Lake lists performance cores first, this is not guaranteed to always be the case in the future.
This commit is contained in:
parent
283331412a
commit
f41f73f6c3
|
@ -151,12 +151,16 @@ public:
|
||||||
cpuSets.erase(cpuSets.begin());
|
cpuSets.erase(cpuSets.begin());
|
||||||
}
|
}
|
||||||
// Otherwise: Multiple physical cores
|
// Otherwise: Multiple physical cores
|
||||||
// Assign the first logical and physical core to Xbox, leave the rest of that
|
// Assign the first highest performance logical and physical core to Xbox,
|
||||||
// physical core unassigned (if hyperthreading is active), the remaining
|
// leave the rest of that physical core unassigned (if hyperthreading is active),
|
||||||
// physical cores to other threads
|
// give the remaining physical cores to other threads
|
||||||
else {
|
else {
|
||||||
const BYTE physicalCore = cpuSets[0]->CoreIndex;
|
auto highPerfCore = std::max_element(cpuSets.begin(), cpuSets.end(), [](const auto* left, const auto* right)
|
||||||
m_xboxCPUSet = cpuSets[0]->Id;
|
{
|
||||||
|
return left->EfficiencyClass < right->EfficiencyClass;
|
||||||
|
});
|
||||||
|
const BYTE physicalCore = (*highPerfCore)->CoreIndex;
|
||||||
|
m_xboxCPUSet = (*highPerfCore)->Id;
|
||||||
for (auto it = cpuSets.begin(); it != cpuSets.end(); ) {
|
for (auto it = cpuSets.begin(); it != cpuSets.end(); ) {
|
||||||
if ((*it)->CoreIndex == physicalCore) {
|
if ((*it)->CoreIndex == physicalCore) {
|
||||||
it = cpuSets.erase(it);
|
it = cpuSets.erase(it);
|
||||||
|
|
Loading…
Reference in New Issue