> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PIXGetPowerMetrics

> PIXGetPowerMetrics 會讀取 XBOX Series 主機上目前的 GPU 電源負載，讓遊戲在遊玩期間能追蹤並調整其整體耗電量。

# PIXGetPowerMetrics

傳回 XBOX Series 主機上目前的電源負載。

<Note>
  XBOX One 系列主機不支援電源負載值。在這些主機上，由 PIXGetPowerMetrics 填入的 [PIXPowerMetrics](/zh-TW/reference/tools/pix3/structs/pixpowermetrics) 結構一律會包含 0 的電源負載值。
</Note>

PIXGetPowerMetrics 可協助開發人員追蹤其遊戲的整體耗電量。此 API 的設計目的，是讓開發人員能夠進行玩家看不到的針對性變更，以協助降低其遊戲在主機上執行時的整體電力使用量。

## 語法

```cpp theme={null}
HRESULT PIXGetPowerMetrics(PPIXPowerMetrics metrics)
```

### 參數

*metrics*   <br />類型：PPIXPowerMetrics

[PIXPowerMetrics](/zh-TW/reference/tools/pix3/structs/pixpowermetrics) 結構的指標。傳回時，PIXPowerMetrics 結構的 `GpuAvgPowerLoadPct` 欄位會填入主機上目前的電源負載值。在 XBOX Series 主機上，電源負載值是 0 到 100 的百分比。在 XBOX One 系列主機上，電源負載值一律為 0。

### 傳回值

類型：HRESULT

## 備註

PIXGetPowerMetrics 傳回的電源負載值，與 PIX [System Monitor](/zh-TW/tools/tools-console/pix/pix-system-monitor) 中 `Power Monitor` 節點下的 `Load %` 計數器所報告的值相同。此值也會顯示在 XBOX 開發套件的[前面板](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/dev-kits/concepts/scorpio-frontpanel)上。

判斷 XBOX Series S 主機的電源負載時，在 XBOX Series X 開發套件上以 `Lockhart profiling mode` 執行時 PIXGetPowerMetrics 傳回的值可用於調整遊戲，但若要取得精確的讀數 (例如用於碳排放計算)，則應直接在 XBOX Series S 測試套件上呼叫 PIXGetPowerMetrics。

## 需求

**標頭：** pix3.h

**程式庫：** pixevt.lib

**支援的平台：** XBOX Series 主機

## 另請參閱

[PIX3](/zh-TW/reference/tools/pix3/pix3_members)<br />[PIX](/zh-TW/tools/tools-console/pix/pix)<br />[PIXPowerMetrics](/zh-TW/reference/tools/pix3/structs/pixpowermetrics)


## Related topics

- [Measure power consumption with your devkit](/build/game-principles/sustainability/sustainability-devkit-guide.md)
- [PIX3](/reference/tools/pix3/pix3_members.md)
- [Call of Duty: Modern Warfare II & Warzone case study](/build/game-principles/sustainability/case-studies/case-studies-cod.md)
- [《使命召唤：现代战争 II》与《Warzone》案例研究](/zh-CN/build/game-principles/sustainability/case-studies/case-studies-cod.md)
- [Caso práctico de Call of Duty: Modern Warfare II y Warzone](/es/build/game-principles/sustainability/case-studies/case-studies-cod.md)
