docs: update RHI API docs
This commit is contained in:
31
docs/api/rhi/d3d12/root-signature/get-native-handle.md
Normal file
31
docs/api/rhi/d3d12/root-signature/get-native-handle.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# D3D12RootSignature::GetNativeHandle
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void* GetNativeHandle() const
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取底层 `ID3D12RootSignature` 接口指针的原生句柄。
|
||||
|
||||
## 返回值
|
||||
|
||||
`void*` - 指向 `ID3D12RootSignature` 接口的指针
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
void* handle = rootSignature->GetNativeHandle();
|
||||
ID3D12RootSignature* rs = static_cast<ID3D12RootSignature*>(handle);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12RootSignature](root-signature.md) - 类总览
|
||||
- [D3D12RootSignature::GetRootSignature](get-root-signature.md) - 获取 D3D12 根签名接口
|
||||
48
docs/api/rhi/d3d12/root-signature/initialize.md
Normal file
48
docs/api/rhi/d3d12/root-signature/initialize.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# D3D12RootSignature::Initialize
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
bool Initialize(ID3D12Device* device, const D3D12_ROOT_SIGNATURE_DESC& desc)
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
初始化 D3D12 根签名对象,使用提供的描述符序列化并创建根签名。
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `device` | `ID3D12Device*` | D3D12 设备指针 |
|
||||
| `desc` | `const D3D12_ROOT_SIGNATURE_DESC&` | 根签名描述符 |
|
||||
|
||||
## 返回值
|
||||
|
||||
`bool` - 初始化成功返回 `true`,失败返回 `false`
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(n),n 为参数和采样器数量
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
D3D12RootSignature rootSig;
|
||||
|
||||
D3D12_ROOT_SIGNATURE_DESC desc = D3D12RootSignature::CreateDesc(
|
||||
parameters.data(),
|
||||
parameters.size(),
|
||||
samplers.data(),
|
||||
samplers.size());
|
||||
|
||||
if (rootSig.Initialize(device, desc)) {
|
||||
// 根签名创建成功
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12RootSignature](root-signature.md) - 类总览
|
||||
- [D3D12RootSignature::Shutdown](shutdown.md) - 关闭根签名
|
||||
- [D3D12RootSignature::CreateDesc](create-desc.md) - 创建描述符
|
||||
@@ -2,16 +2,18 @@
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 根签名的 D3D12 实现。**不继承 RHI 抽象接口**,是 D3D12 特有的封装类。
|
||||
**类型**: `class` (D3D12-specific, does not inherit from RHI)
|
||||
|
||||
**描述**: DirectX 12 根签名的 D3D12 实现,提供根签名序列化、参数创建等功能。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](../../../threading/task-system/initialize.md) | 初始化根签名 |
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭根签名 |
|
||||
| [`Initialize`](initialize.md) | 初始化根签名 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭根签名 |
|
||||
| [`GetRootSignature`](get-root-signature.md) | 获取 D3D12 根签名 |
|
||||
| [`GetNativeHandle`](../../buffer/get-native-handle.md) | 获取原生句柄 |
|
||||
| [`GetNativeHandle`](get-native-handle.md) | 获取原生句柄 |
|
||||
| [`GetParameterCount`](get-parameter-count.md) | 获取参数数量 |
|
||||
| [`CreateDesc`](create-desc.md) | 创建根签名描述符(静态) |
|
||||
| [`CreateCBV`](create-cbv.md) | 创建常量缓冲区视图(静态) |
|
||||
@@ -23,6 +25,23 @@
|
||||
| [`CreateSamplerDesc`](create-sampler-desc.md) | 创建采样器描述符(静态) |
|
||||
| [`CreateDescriptorRange`](create-descriptor-range.md) | 创建描述符范围(静态) |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
D3D12RootSignature rootSig;
|
||||
|
||||
D3D12_ROOT_PARAMETER params[2] = {};
|
||||
params[0] = D3D12RootSignature::CreateCBV(0);
|
||||
params[1] = D3D12RootSignature::CreateSRV(0);
|
||||
|
||||
D3D12_ROOT_SIGNATURE_DESC desc = D3D12RootSignature::CreateDesc(params, 2);
|
||||
|
||||
if (rootSig.Initialize(device, desc)) {
|
||||
ID3D12RootSignature* rs = rootSig.GetRootSignature();
|
||||
rootSig.Shutdown();
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
|
||||
30
docs/api/rhi/d3d12/root-signature/shutdown.md
Normal file
30
docs/api/rhi/d3d12/root-signature/shutdown.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# D3D12RootSignature::Shutdown
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void Shutdown()
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
关闭并释放 D3D12 根签名资源。
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
D3D12RootSignature rootSig;
|
||||
if (rootSig.Initialize(device, desc)) {
|
||||
// 使用根签名
|
||||
rootSig.Shutdown();
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12RootSignature](root-signature.md) - 类总览
|
||||
- [D3D12RootSignature::Initialize](initialize.md) - 初始化根签名
|
||||
Reference in New Issue
Block a user