The SYSTEM_CPU_SET_INFORMATION structure returned by GetSystemCpuSetInformation exposes details that the game can use to scale the number of threads it runs, and give threads the affinity for the appropriate cores using SetThreadSelectedCpuSets. Using this function, deeper inspection, such as getting cache details, can be achieved to rank the cores for performance. When they have been granted, the game can call GetSystemCpuSetInformation to understand what cores the game is eligible to use. Games should call HasExpandedResources once per frame or game tick to determine whether exclusive resources have been granted. You can publish a UWP app with this capability to the Store if it targets desktop, but if it targets Xbox it will be rejected in certification. This capability is granted on a per-title basis contact your account manager for more information.
Alternatively, you can edit the file's code directly: ReleaseExclusiveCpuSets requires the expandedResources restricted capability, which you can select by opening Package.appxmanifest in Visual Studio and navigating to the Capabilities tab. ReleaseExclusiveCpuSets: Opt out of CPU exclusivity.The general pattern is to poll once per frame. When the game exits Game Mode, it can scale back the usage of resources. When the game enters Game Mode, it can provide a tailored experience. HasExpandedResources: Know when the game enters and exits Game Mode.GetExpandedResourceExclusiveCpuCount: Query for details of exclusive hardware, such as cache topology, in order to rank resources.The Game Mode API has the following members: As part of launching the game, the process will go into Game Mode with a set of defaults, and you can use the APIs to see what resources are available on the customer's device. You can leverage the available system resources in a way that best fits your game design and the configuration of the customer's system.īy using the expandedResources capability, you can explicitly declare that the game will work with Game Mode.
However, you can use the Game Mode API to take it a step further and programmatically query for available system resources, determining whether the operating system considers each resource as shared or exclusive.
Game Mode works by default for most Windows games, requiring no action or opt-in by the customer, and no work by the game developer. The app must be in the foreground and have focus before exclusive resources are granted.