> ## 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.

# SetGraphicsShaderLimitsX (XBOX One 系列)

> SetGraphicsShaderLimitsX (XBOX One 系列主機) — 設定頂點、網域、幾何和像素著色器的圖形著色器限制。部分限制包括。

設定頂點、網域、幾何和像素著色器的圖形著色器限制。部分限制包括作用中的著色器單元、同時執行的波 (wave) 數目上限，以及允許 CU 鎖定的波數目上限。

## 語法

```cpp theme={null}
void SetGraphicsShaderLimitsX(  
         BOOL PixelShaderEnabled,  
         BOOL TessellationEnabled,  
         BOOL GeometryShaderEnabled,  
         BOOL GeometryShaderOnChip,  
         const D3D12XBOX_GRAPHICS_SHADER_LIMITS_DESC* pShaderLimits  
)  
```

### 參數

*PixelShaderEnabled*   \_In\_\
類型：BOOL

設定為 **true** 以啟用像素著色器；否則設定為 **false**。

*TessellationEnabled*   \_In\_\
類型：BOOL

設定為 **true** 以啟用鑲嵌器；否則設定為 **false**。

*GeometryShaderEnabled*   \_In\_\
類型：BOOL

設定為 **true** 以啟用幾何著色器；否則設定為 **false**。

*GeometryShaderOnChip*   \_In\_\
類型：BOOL

設定為 **true** 以指定產生的幾何保留在 GPU 記憶體中，且會延伸至系統記憶體。

*pShaderLimits*   \_In\_opt\_\
類型：[D3D12XBOX\_GRAPHICS\_SHADER\_LIMITS\_DESC\*](/zh-TW/reference/graphics/d3d12_x/structs/d3d12xbox_graphics_shader_limits_desc)

指向 [D3D12XBOX\_GRAPHICS\_SHADER\_LIMITS\_DESC](/zh-TW/reference/graphics/d3d12_x/structs/d3d12xbox_graphics_shader_limits_desc) 結構的指標，該結構描述計算著色器的限制。

### 傳回值

類型：void

無。

## 備註

**SetGraphicsShaderLimitsX** 用於覆寫目前設定之管線狀態物件 (PSO) 所建立的著色器限制。覆寫的限制會持續有效，直到重設 PSO 或設定新的 PSO 為止；這包括 [ExecuteIndirect](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-executeindirect) 所參考的任何 PSO。

**SetGraphicsShaderLimitsX** 無法錄製到命令套件組合中，而且 *PixelShaderEnabled* 等著色器管線設定參數必須全部與目前 PSO 的參數相符；如果不相符，驗證會使呼叫失敗。

## 需求

**標頭：** d3d12\_x.h

**程式庫：** d3d12\_x.lib

**支援的平台：** XBOX One 系列

## 另請參閱

[ID3D12GraphicsCommandList](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/id3d12graphicscommandlist)\
[SetComputeShaderLimitsX](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setcomputeshaderlimitsx)


## Related topics

- [SetGraphicsRootShaderResourceView](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setgraphicsrootshaderresourceview_public.md)
- [SetComputeRootShaderResourceView](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setcomputerootshaderresourceview_public.md)
- [NDA topic directory - live Microsoft Learn links](/nda/nda-topic-directory.md)
- [D3D_SHADER_MODEL](/zh-CN/reference/graphics/d3d12/enums/d3d_shader_model_public.md)
- [D3D12_SHADER_VISIBILITY](/zh-CN/reference/graphics/d3d12/enums/d3d12_shader_visibility_public.md)
