docs: update RHI API docs
This commit is contained in:
@@ -9,10 +9,22 @@ ResourceStates GetResourceState(ID3D12Resource* resource) const;
|
||||
**参数:**
|
||||
- `resource` - D3D12 资源指针
|
||||
|
||||
**返回:** 资源当前状态
|
||||
**返回值:** 资源当前状态,如果资源未被跟踪则返回 `ResourceStates::Common`
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
ID3D12Resource* resource = /* 获取资源 */;
|
||||
ResourceStates state = cmdList.GetResourceState(resource);
|
||||
if (state == ResourceStates::RenderTarget) {
|
||||
// 资源当前为渲染目标状态
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
- [TrackResource](track-resource.md) - 跟踪资源
|
||||
- [TransitionBarrier](transition-barrier.md) - 资源状态转换
|
||||
Reference in New Issue
Block a user