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

# D3D12_SAMPLE_POSITION

> 描述子像素取樣位置，搭配可程式化取樣位置使用。

描述子像素取樣位置，搭配可程式化取樣位置使用。

## 語法

```cpp theme={null}
typedef struct D3D12_SAMPLE_POSITION
{
    INT8 X;
    INT8 Y;
} D3D12_SAMPLE_POSITION
```

### 成員

*X*\
類型：INT8

X 軸上帶正負號的子像素座標值。

*Y*\
類型：INT8

Y 軸上帶正負號的子像素座標值。

## 備註

取樣位置的原點 (0, 0) 位於像素中心。X 和 Y 座標都是帶正負號的值，範圍為 -8 (上/左) 到 7 (下/右)。超出此範圍的值無效。

這些整數值的每次遞增代表 1/16 個像素。例如，X 和 Y 值分別為 -8 和 4 時，對應到浮點值 -0.5 和 0.25，也就是位於像素最左側邊緣、介於其中心線與底部邊緣中間的點。因此，取樣無法觸及像素的最底部和最右側邊緣 (這些位置可作為相鄰像素的最頂部和最左側邊緣而觸及)。

## 需求

**標頭:** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫:** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台**: XBOX Series 主機與 XBOX One 系列

## 另請參閱

[核心結構](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [SetSamplePositions](/zh-TW/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist1/methods/id3d12graphicscommandlist1_setsamplepositions_public.md)
- [D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER](/zh-TW/reference/graphics/d3d12/enums/d3d12_programmable_sample_positions_tier_public.md)
- [D3D12_FEATURE_DATA_D3D12_OPTIONS2](/zh-TW/reference/graphics/d3d12/structs/d3d12_feature_data_d3d12_options2_public.md)
- [D3D12_SAMPLER_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_sampler_desc_public.md)
- [D3D12_STATIC_SAMPLER_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_static_sampler_desc_public.md)
