33 lines
537 B
Markdown
33 lines
537 B
Markdown
|
|
# D3D12Texture::GetDepth
|
|||
|
|
|
|||
|
|
获取纹理深度或数组大小。
|
|||
|
|
|
|||
|
|
```cpp
|
|||
|
|
uint32_t GetDepth() const override;
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 参数
|
|||
|
|
|
|||
|
|
无
|
|||
|
|
|
|||
|
|
## 返回值
|
|||
|
|
|
|||
|
|
`uint32_t` - 纹理深度(3D 纹理)或数组大小(1D/2D 纹理数组)
|
|||
|
|
|
|||
|
|
**线程安全:** ❌
|
|||
|
|
|
|||
|
|
**复杂度:** O(1)
|
|||
|
|
|
|||
|
|
## 示例
|
|||
|
|
|
|||
|
|
```cpp
|
|||
|
|
D3D12Texture texture;
|
|||
|
|
texture.Initialize(device, desc);
|
|||
|
|
uint32_t depth = texture.GetDepth();
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 相关文档
|
|||
|
|
|
|||
|
|
- [D3D12Texture 总览](texture.md)
|
|||
|
|
- [GetWidth](get-width.md) - 获取纹理宽度
|
|||
|
|
- [GetHeight](get-height.md) - 获取纹理高度
|