fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
37
docs/api/rhi/d3d12/buffer/buffer.md
Normal file
37
docs/api/rhi/d3d12/buffer/buffer.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# D3D12Buffer
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 缓冲区的 D3D12 实现,继承自 `RHIBuffer`。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](initialize.md) | 初始化缓冲区 |
|
||||
| [`InitializeFromExisting`](initialize-from-existing.md) | 从现有资源初始化 |
|
||||
| [`InitializeWithData`](initialize-with-data.md) | 初始化并写入数据 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭缓冲区 |
|
||||
| [`UpdateData`](update-data.md) | 更新数据 |
|
||||
| [`Map`](map.md) | 映射缓冲区 |
|
||||
| [`Unmap`](unmap.md) | 取消映射 |
|
||||
| [`SetData`](set-data.md) | 设置数据 |
|
||||
| [`GetResource`](get-resource.md) | 获取 D3D12 资源 |
|
||||
| [`GetDesc`](get-desc.md) | 获取描述符 |
|
||||
| [`GetGPUVirtualAddress`](get-gpu-virtual-address.md) | 获取 GPU 虚拟地址 |
|
||||
| [`GetGPUAddress`](get-gpu-address.md) | 获取 GPU 地址 |
|
||||
| [`GetSize`](get-size.md) | 获取缓冲区大小 |
|
||||
| [`GetState`](get-state.md) | 获取资源状态 |
|
||||
| [`SetState`](../../buffer/set-state.md) | 设置资源状态 |
|
||||
| [`GetName`](get-name.md) | 获取资源名称 |
|
||||
| [`SetName`](../../buffer/set-name.md) | 设置资源名称 |
|
||||
| [`GetStride`](get-stride.md) | 获取步长 |
|
||||
| [`SetStride`](../../buffer/set-stride.md) | 设置步长 |
|
||||
| [`GetBufferType`](get-buffer-type.md) | 获取缓冲区类型 |
|
||||
| [`SetBufferType`](../../buffer/set-buffer-type.md) | 设置缓冲区类型 |
|
||||
| [`GetNativeHandle`](get-native-handle.md) | 获取原生句柄 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
- [RHIBuffer](../../buffer/buffer.md) - 抽象缓冲区接口
|
||||
16
docs/api/rhi/d3d12/buffer/get-buffer-type.md
Normal file
16
docs/api/rhi/d3d12/buffer/get-buffer-type.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12Buffer::GetBufferType / SetBufferType
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
BufferType GetBufferType() const override
|
||||
void SetBufferType(BufferType type) override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取和设置缓冲区类型(Vertex / Index / Constant 等)。
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
19
docs/api/rhi/d3d12/buffer/get-desc.md
Normal file
19
docs/api/rhi/d3d12/buffer/get-desc.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Buffer::GetDesc
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
D3D12_RESOURCE_DESC GetDesc() const
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取 D3D12 资源描述结构。
|
||||
|
||||
## 返回值
|
||||
|
||||
`D3D12_RESOURCE_DESC` - 资源描述
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
19
docs/api/rhi/d3d12/buffer/get-gpu-address.md
Normal file
19
docs/api/rhi/d3d12/buffer/get-gpu-address.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Buffer::GetGPUAddress
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
uint64_t GetGPUAddress() const
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取 GPU 地址(等同于 `GetGPUVirtualAddress`)。
|
||||
|
||||
## 返回值
|
||||
|
||||
`uint64_t` - GPU 地址
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
19
docs/api/rhi/d3d12/buffer/get-gpu-virtual-address.md
Normal file
19
docs/api/rhi/d3d12/buffer/get-gpu-virtual-address.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Buffer::GetGPUVirtualAddress
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
D3D12_GPU_VIRTUAL_ADDRESS GetGPUVirtualAddress() const
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取 GPU 虚拟地址,用于根签名绑定。
|
||||
|
||||
## 返回值
|
||||
|
||||
`D3D12_GPU_VIRTUAL_ADDRESS` - GPU 虚拟地址
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
16
docs/api/rhi/d3d12/buffer/get-name.md
Normal file
16
docs/api/rhi/d3d12/buffer/get-name.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12Buffer::GetName / SetName
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
const std::string& GetName() const override
|
||||
void SetName(const std::string& name) override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取和设置对象名称(用于调试)。
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
19
docs/api/rhi/d3d12/buffer/get-native-handle.md
Normal file
19
docs/api/rhi/d3d12/buffer/get-native-handle.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Buffer::GetNativeHandle
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void* GetNativeHandle() override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
返回原生句柄,即 `ID3D12Resource*`。
|
||||
|
||||
## 返回值
|
||||
|
||||
`void*` - 原生句柄
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
19
docs/api/rhi/d3d12/buffer/get-resource.md
Normal file
19
docs/api/rhi/d3d12/buffer/get-resource.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Buffer::GetResource
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
ID3D12Resource* GetResource() const
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取底层 `ID3D12Resource` 指针。
|
||||
|
||||
## 返回值
|
||||
|
||||
`ID3D12Resource*` - D3D12 资源指针
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
19
docs/api/rhi/d3d12/buffer/get-size.md
Normal file
19
docs/api/rhi/d3d12/buffer/get-size.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Buffer::GetSize
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
uint64_t GetSize() const override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取缓冲区大小(字节)。
|
||||
|
||||
## 返回值
|
||||
|
||||
`uint64_t` - 缓冲区大小
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
16
docs/api/rhi/d3d12/buffer/get-state.md
Normal file
16
docs/api/rhi/d3d12/buffer/get-state.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12Buffer::GetState / SetState
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
ResourceStates GetState() const
|
||||
void SetState(ResourceStates state)
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取和设置当前资源状态。用于状态跟踪和屏障生成。
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
16
docs/api/rhi/d3d12/buffer/get-stride.md
Normal file
16
docs/api/rhi/d3d12/buffer/get-stride.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12Buffer::GetStride / SetStride
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
uint32_t GetStride() const override
|
||||
void SetStride(uint32_t stride) override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
获取和设置顶点缓冲区步长(字节)。
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
35
docs/api/rhi/d3d12/buffer/initialize-from-existing.md
Normal file
35
docs/api/rhi/d3d12/buffer/initialize-from-existing.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# D3D12Buffer::InitializeFromExisting
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
bool InitializeFromExisting(ID3D12Resource* resource)
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
从已存在的 D3D12 资源对象初始化缓冲区包装类,不分配新资源。
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `resource` | `ID3D12Resource*` | 已存在的 D3D12 资源指针 |
|
||||
|
||||
## 返回值
|
||||
|
||||
`bool` - 初始化是否成功
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
ComPtr<ID3D12Resource> existingResource;
|
||||
device->CreateReservedResource(&desc, state, nullptr, IID_PPV_ARGS(&existingResource));
|
||||
|
||||
D3D12Buffer buffer;
|
||||
buffer.InitializeFromExisting(existingResource.Get());
|
||||
```
|
||||
42
docs/api/rhi/d3d12/buffer/initialize-with-data.md
Normal file
42
docs/api/rhi/d3d12/buffer/initialize-with-data.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# D3D12Buffer::InitializeWithData
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
bool InitializeWithData(ID3D12Device* device, ID3D12GraphicsCommandList* commandList, const void* data, uint64_t size, D3D12_RESOURCE_STATES finalState)
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
创建缓冲区并通过命令列表从内存数据初始化内容。内部会自动创建上传堆、复制数据、转换状态。
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `device` | `ID3D12Device*` | D3D12 设备指针 |
|
||||
| `commandList` | `ID3D12GraphicsCommandList*` | 命令列表(用于复制操作) |
|
||||
| `data` | `const void*` | 初始数据指针 |
|
||||
| `size` | `uint64_t` | 数据大小(字节) |
|
||||
| `finalState` | `D3D12_RESOURCE_STATES` | 数据复制完成后的目标状态 |
|
||||
|
||||
## 返回值
|
||||
|
||||
`bool` - 初始化是否成功
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(n) - 取决于数据大小,内部创建临时上传堆
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
uint16_t indices[] = { 0, 1, 2, 1, 3, 2 };
|
||||
D3D12Buffer indexBuffer;
|
||||
D3D12Buffer::InitializeWithData(
|
||||
device->GetDevice(),
|
||||
cmdList->GetCommandList(),
|
||||
indices,
|
||||
sizeof(indices),
|
||||
D3D12_RESOURCE_STATE_INDEX_BUFFER);
|
||||
```
|
||||
39
docs/api/rhi/d3d12/buffer/initialize.md
Normal file
39
docs/api/rhi/d3d12/buffer/initialize.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# D3D12Buffer::Initialize
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
bool Initialize(ID3D12Device* device, uint64_t size, D3D12_RESOURCE_STATES initialState = D3D12_RESOURCE_STATE_COMMON, D3D12_HEAP_TYPE heapType = D3D12_HEAP_TYPE_DEFAULT)
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
创建新缓冲区,分配 D3D12 显存资源。
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `device` | `ID3D12Device*` | D3D12 设备指针 |
|
||||
| `size` | `uint64_t` | 缓冲区大小(字节) |
|
||||
| `initialState` | `D3D12_RESOURCE_STATES` | 初始资源状态(默认 COMMON) |
|
||||
| `heapType` | `D3D12_HEAP_TYPE` | 堆类型:DEFAULT(默认)、UPLOAD(上传)、READBACK(回读) |
|
||||
|
||||
## 返回值
|
||||
|
||||
`bool` - 初始化是否成功
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(n) - 取决于缓冲区大小
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
D3D12Buffer vertexBuffer;
|
||||
vertexBuffer.Initialize(
|
||||
device->GetDevice(),
|
||||
sizeof(Vertex) * vertexCount,
|
||||
D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER,
|
||||
D3D12_HEAP_TYPE_DEFAULT);
|
||||
```
|
||||
27
docs/api/rhi/d3d12/buffer/map.md
Normal file
27
docs/api/rhi/d3d12/buffer/map.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# D3D12Buffer::Map
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void* Map() override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
将缓冲区内存映射到 CPU 可访问地址。仅对 UPLOAD 或 READBACK 堆有效。
|
||||
|
||||
## 返回值
|
||||
|
||||
`void*` - 映射的内存指针
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
void* mapped = uploadBuffer.Map();
|
||||
memcpy(mapped, vertexData, sizeof(vertexData));
|
||||
buffer.Unmap();
|
||||
```
|
||||
23
docs/api/rhi/d3d12/buffer/set-data.md
Normal file
23
docs/api/rhi/d3d12/buffer/set-data.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# D3D12Buffer::SetData
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void SetData(const void* data, size_t size, size_t offset = 0) override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
设置缓冲区数据。通过 Map/Unmap 实现。
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `data` | `const void*` | 数据指针 |
|
||||
| `size` | `size_t` | 数据大小 |
|
||||
| `offset` | `size_t` | 缓冲区内的偏移量 |
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(n)
|
||||
15
docs/api/rhi/d3d12/buffer/shutdown.md
Normal file
15
docs/api/rhi/d3d12/buffer/shutdown.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12Buffer::Shutdown
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void Shutdown() override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
释放 D3D12 缓冲区资源,将成员变量置为空。
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
15
docs/api/rhi/d3d12/buffer/unmap.md
Normal file
15
docs/api/rhi/d3d12/buffer/unmap.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12Buffer::Unmap
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void Unmap() override
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
解除缓冲区内存映射。
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(1)
|
||||
28
docs/api/rhi/d3d12/buffer/update-data.md
Normal file
28
docs/api/rhi/d3d12/buffer/update-data.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# D3D12Buffer::UpdateData
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void UpdateData(const void* data, uint64_t size)
|
||||
```
|
||||
|
||||
## 中文描述
|
||||
|
||||
更新缓冲区数据。要求缓冲区使用 UPLOAD 堆类型,否则行为未定义。
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `data` | `const void*` | 新数据指针 |
|
||||
| `size` | `uint64_t` | 数据大小 |
|
||||
|
||||
## 复杂度
|
||||
|
||||
O(n)
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
uploadBuffer.UpdateData(newData, dataSize);
|
||||
```
|
||||
19
docs/api/rhi/d3d12/command-allocator/command-allocator.md
Normal file
19
docs/api/rhi/d3d12/command-allocator/command-allocator.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12CommandAllocator
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 命令分配器的 D3D12 实现。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](../../../threading/task-system/initialize.md) | 初始化命令分配器 |
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭命令分配器 |
|
||||
| [`Reset`](../../command-list/reset.md) | 重置命令分配器 |
|
||||
| [`IsReady`](is-ready.md) | 检查是否就绪 |
|
||||
| [`GetCommandAllocator`](get-command-allocator.md) | 获取 D3D12 命令分配器 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
@@ -0,0 +1,15 @@
|
||||
# D3D12CommandAllocator::GetCommandAllocator
|
||||
|
||||
```cpp
|
||||
ID3D12CommandAllocator* GetCommandAllocator() const { return m_commandAllocator.Get(); }
|
||||
```
|
||||
|
||||
获取底层的 D3D12 命令分配器接口。
|
||||
|
||||
**返回:** `ID3D12CommandAllocator*`
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandAllocator 总览](command-allocator.md) - 返回类总览
|
||||
15
docs/api/rhi/d3d12/command-allocator/is-ready.md
Normal file
15
docs/api/rhi/d3d12/command-allocator/is-ready.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12CommandAllocator::IsReady
|
||||
|
||||
```cpp
|
||||
bool IsReady() const;
|
||||
```
|
||||
|
||||
检查命令分配器是否准备就绪。
|
||||
|
||||
**返回:** 分配器是否准备就绪
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandAllocator 总览](command-allocator.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-list/alias-barrier.md
Normal file
17
docs/api/rhi/d3d12/command-list/alias-barrier.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::AliasBarrier
|
||||
|
||||
```cpp
|
||||
void AliasBarrier(void* beforeResource = nullptr, void* afterResource = nullptr);
|
||||
```
|
||||
|
||||
添加资源别名屏障。
|
||||
|
||||
**参数:**
|
||||
- `beforeResource` - 别名切换前的资源
|
||||
- `afterResource` - 别名切换后的资源
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/begin-query.md
Normal file
18
docs/api/rhi/d3d12/command-list/begin-query.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::BeginQuery
|
||||
|
||||
```cpp
|
||||
void BeginQuery(ID3D12QueryHeap* queryHeap, QueryType type, uint32_t index);
|
||||
```
|
||||
|
||||
开始查询。
|
||||
|
||||
**参数:**
|
||||
- `queryHeap` - 查询堆
|
||||
- `type` - 查询类型
|
||||
- `index` - 查询索引
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/clear-depth-stencil.md
Normal file
18
docs/api/rhi/d3d12/command-list/clear-depth-stencil.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::ClearDepthStencil
|
||||
|
||||
```cpp
|
||||
void ClearDepthStencil(void* depthStencil, float depth, uint8_t stencil) override;
|
||||
```
|
||||
|
||||
清除深度模板。
|
||||
|
||||
**参数:**
|
||||
- `depthStencil` - 深度模板指针
|
||||
- `depth` - 深度值
|
||||
- `stencil` - 模板值
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-list/clear-render-target.md
Normal file
17
docs/api/rhi/d3d12/command-list/clear-render-target.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::ClearRenderTarget
|
||||
|
||||
```cpp
|
||||
void ClearRenderTarget(void* renderTarget, const float color[4]) override;
|
||||
```
|
||||
|
||||
清除渲染目标。
|
||||
|
||||
**参数:**
|
||||
- `renderTarget` - 渲染目标指针
|
||||
- `color` - 清除颜色 [r, g, b, a]
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
65
docs/api/rhi/d3d12/command-list/command-list.md
Normal file
65
docs/api/rhi/d3d12/command-list/command-list.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# D3D12CommandList
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 命令列表的 D3D12 实现,继承自 `RHICommandList`。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭命令列表 |
|
||||
| [`Reset`](../../command-list/reset.md) | 重置命令列表 |
|
||||
| [`Close`](../../command-list/close.md) | 关闭命令列表 |
|
||||
| [`GetCommandList`](get-command-list.md) | 获取 D3D12 命令列表 |
|
||||
| [`TransitionBarrier`](transition-barrier.md) | 资源状态转换 |
|
||||
| [`TransitionBarrierInternal`](transition-barrier-internal.md) | 内部资源状态转换 |
|
||||
| [`UAVBarrier`](uav-barrier.md) | UAV 屏障 |
|
||||
| [`AliasBarrier`](alias-barrier.md) | 别名屏障 |
|
||||
| [`SetPipelineState`](set-pipeline-state.md) | 设置管线状态 |
|
||||
| [`SetRootSignature`](set-root-signature.md) | 设置根签名 |
|
||||
| [`SetPrimitiveTopology`](set-primitive-topology.md) | 设置图元拓扑 |
|
||||
| [`SetViewport`](set-viewport.md) | 设置视口 |
|
||||
| [`SetViewports`](set-viewports.md) | 设置多个视口 |
|
||||
| [`SetScissorRect`](set-scissor-rect.md) | 设置裁剪矩形 |
|
||||
| [`SetScissorRects`](set-scissor-rects.md) | 设置多个裁剪矩形 |
|
||||
| [`SetRenderTargets`](set-render-targets.md) | 设置渲染目标 |
|
||||
| [`SetRenderTargetsInternal`](set-render-targets-internal.md) | 内部渲染目标设置 |
|
||||
| [`SetRenderTargetsHandle`](set-render-targets-handle.md) | 句柄渲染目标设置 |
|
||||
| [`SetVertexBuffer`](set-vertex-buffer.md) | 设置顶点缓冲 |
|
||||
| [`SetVertexBuffers`](set-vertex-buffers.md) | 设置多个顶点缓冲 |
|
||||
| [`SetIndexBuffer`](set-index-buffer.md) | 设置索引缓冲 |
|
||||
| [`SetDescriptorHeap`](set-descriptor-heap.md) | 设置描述符堆 |
|
||||
| [`SetDescriptorHeaps`](set-descriptor-heaps.md) | 设置多个描述符堆 |
|
||||
| [`SetGraphicsDescriptorTable`](set-graphics-descriptor-table.md) | 设置图形描述符表 |
|
||||
| [`SetComputeDescriptorTable`](set-compute-descriptor-table.md) | 设置计算描述符表 |
|
||||
| [`SetGraphicsRootConstantBufferView`](set-graphics-root-constant-buffer-view.md) | 设置图形根常量缓冲视图 |
|
||||
| [`SetGraphicsRoot32BitConstants`](set-graphics-root-32bit-constants.md) | 设置图形根 32 位常量 |
|
||||
| [`SetGraphicsRootDescriptorTable`](set-graphics-root-descriptor-table.md) | 设置图形根描述符表 |
|
||||
| [`SetGraphicsRootShaderResourceView`](set-graphics-root-shader-resource-view.md) | 设置图形根着色器资源视图 |
|
||||
| [`SetStencilRef`](set-stencil-ref.md) | 设置模板引用值 |
|
||||
| [`SetBlendFactor`](set-blend-factor.md) | 设置混合因子 |
|
||||
| [`SetDepthBias`](set-depth-bias.md) | 设置深度偏移 |
|
||||
| [`Draw`](draw.md) | 绘制 |
|
||||
| [`DrawIndexed`](draw-indexed.md) | 索引绘制 |
|
||||
| [`DrawInstancedIndirect`](draw-instanced-indirect.md) | 实例化间接绘制 |
|
||||
| [`DrawIndexedInstancedIndirect`](draw-indexed-instanced-indirect.md) | 索引实例化间接绘制 |
|
||||
| [`Clear`](../../command-list/clear.md) | 清除 |
|
||||
| [`ClearRenderTarget`](clear-render-target.md) | 清除渲染目标 |
|
||||
| [`ClearDepthStencil`](clear-depth-stencil.md) | 清除深度模板 |
|
||||
| [`CopyResource`](copy-resource.md) | 复制资源 |
|
||||
| [`CopyBuffer`](copy-buffer.md) | 复制缓冲区 |
|
||||
| [`CopyTexture`](copy-texture.md) | 复制纹理 |
|
||||
| [`BeginQuery`](begin-query.md) | 开始查询 |
|
||||
| [`EndQuery`](end-query.md) | 结束查询 |
|
||||
| [`ResolveQueryData`](resolve-query-data.md) | 解析查询数据 |
|
||||
| [`Dispatch`](dispatch.md) | 分发计算任务 |
|
||||
| [`DispatchIndirect`](dispatch-indirect.md) | 间接分发计算任务 |
|
||||
| [`ExecuteBundle`](execute-bundle.md) | 执行 Bundle |
|
||||
| [`GetResourceState`](get-resource-state.md) | 获取资源状态 |
|
||||
| [`TrackResource`](track-resource.md) | 跟踪资源 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
- [RHICommandList](../../command-list/command-list.md) - 抽象命令列表接口
|
||||
20
docs/api/rhi/d3d12/command-list/copy-buffer.md
Normal file
20
docs/api/rhi/d3d12/command-list/copy-buffer.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# D3D12CommandList::CopyBuffer
|
||||
|
||||
```cpp
|
||||
void CopyBuffer(ID3D12Resource* dst, uint64_t dstOffset, ID3D12Resource* src, uint64_t srcOffset, uint64_t size);
|
||||
```
|
||||
|
||||
复制缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `dst` - 目标缓冲区
|
||||
- `dstOffset` - 目标偏移
|
||||
- `src` - 源缓冲区
|
||||
- `srcOffset` - 源偏移
|
||||
- `size` - 复制大小
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-list/copy-resource.md
Normal file
17
docs/api/rhi/d3d12/command-list/copy-resource.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::CopyResource
|
||||
|
||||
```cpp
|
||||
void CopyResource(void* dst, void* src) override;
|
||||
```
|
||||
|
||||
复制资源。
|
||||
|
||||
**参数:**
|
||||
- `dst` - 目标资源指针
|
||||
- `src` - 源资源指针
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
19
docs/api/rhi/d3d12/command-list/copy-texture.md
Normal file
19
docs/api/rhi/d3d12/command-list/copy-texture.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12CommandList::CopyTexture
|
||||
|
||||
```cpp
|
||||
void CopyTexture(ID3D12Resource* dst, const D3D12_TEXTURE_COPY_LOCATION& dstLocation, ID3D12Resource* src, const D3D12_TEXTURE_COPY_LOCATION& srcLocation);
|
||||
```
|
||||
|
||||
复制纹理。
|
||||
|
||||
**参数:**
|
||||
- `dst` - 目标纹理
|
||||
- `dstLocation` - 目标位置
|
||||
- `src` - 源纹理
|
||||
- `srcLocation` - 源位置
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-list/dispatch-indirect.md
Normal file
17
docs/api/rhi/d3d12/command-list/dispatch-indirect.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::DispatchIndirect
|
||||
|
||||
```cpp
|
||||
void DispatchIndirect(void* argBuffer, uint64_t alignedByteOffset);
|
||||
```
|
||||
|
||||
间接分发计算命令。
|
||||
|
||||
**参数:**
|
||||
- `argBuffer` - 参数缓冲区
|
||||
- `alignedByteOffset` - 字节偏移
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/dispatch.md
Normal file
18
docs/api/rhi/d3d12/command-list/dispatch.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::Dispatch
|
||||
|
||||
```cpp
|
||||
void Dispatch(uint32_t x, uint32_t y, uint32_t z) override;
|
||||
```
|
||||
|
||||
分发计算命令。
|
||||
|
||||
**参数:**
|
||||
- `x` - X 维度线程组数量
|
||||
- `y` - Y 维度线程组数量
|
||||
- `z` - Z 维度线程组数量
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::DrawIndexedInstancedIndirect
|
||||
|
||||
```cpp
|
||||
void DrawIndexedInstancedIndirect(void* argBuffer, uint64_t alignedByteOffset);
|
||||
```
|
||||
|
||||
间接绘制索引实例。
|
||||
|
||||
**参数:**
|
||||
- `argBuffer` - 参数缓冲区
|
||||
- `alignedByteOffset` - 字节偏移
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
20
docs/api/rhi/d3d12/command-list/draw-indexed.md
Normal file
20
docs/api/rhi/d3d12/command-list/draw-indexed.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# D3D12CommandList::DrawIndexed
|
||||
|
||||
```cpp
|
||||
void DrawIndexed(uint32_t indexCount, uint32_t instanceCount = 1, uint32_t startIndex = 0, int32_t baseVertex = 0, uint32_t startInstance = 0) override;
|
||||
```
|
||||
|
||||
绘制索引调用。
|
||||
|
||||
**参数:**
|
||||
- `indexCount` - 索引数量
|
||||
- `instanceCount` - 实例数量
|
||||
- `startIndex` - 起始索引
|
||||
- `baseVertex` - 基础顶点偏移
|
||||
- `startInstance` - 起始实例索引
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-list/draw-instanced-indirect.md
Normal file
17
docs/api/rhi/d3d12/command-list/draw-instanced-indirect.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::DrawInstancedIndirect
|
||||
|
||||
```cpp
|
||||
void DrawInstancedIndirect(void* argBuffer, uint64_t alignedByteOffset);
|
||||
```
|
||||
|
||||
间接绘制实例。
|
||||
|
||||
**参数:**
|
||||
- `argBuffer` - 参数缓冲区
|
||||
- `alignedByteOffset` - 字节偏移
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
19
docs/api/rhi/d3d12/command-list/draw.md
Normal file
19
docs/api/rhi/d3d12/command-list/draw.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12CommandList::Draw
|
||||
|
||||
```cpp
|
||||
void Draw(uint32_t vertexCount, uint32_t instanceCount = 1, uint32_t startVertex = 0, uint32_t startInstance = 0) override;
|
||||
```
|
||||
|
||||
绘制调用。
|
||||
|
||||
**参数:**
|
||||
- `vertexCount` - 顶点数量
|
||||
- `instanceCount` - 实例数量
|
||||
- `startVertex` - 起始顶点索引
|
||||
- `startInstance` - 起始实例索引
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/end-query.md
Normal file
18
docs/api/rhi/d3d12/command-list/end-query.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::EndQuery
|
||||
|
||||
```cpp
|
||||
void EndQuery(ID3D12QueryHeap* queryHeap, QueryType type, uint32_t index);
|
||||
```
|
||||
|
||||
结束查询。
|
||||
|
||||
**参数:**
|
||||
- `queryHeap` - 查询堆
|
||||
- `type` - 查询类型
|
||||
- `index` - 查询索引
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/execute-bundle.md
Normal file
16
docs/api/rhi/d3d12/command-list/execute-bundle.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::ExecuteBundle
|
||||
|
||||
```cpp
|
||||
void ExecuteBundle(ID3D12GraphicsCommandList* bundle);
|
||||
```
|
||||
|
||||
执行 Bundle。
|
||||
|
||||
**参数:**
|
||||
- `bundle` - Bundle 命令列表
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
15
docs/api/rhi/d3d12/command-list/get-command-list.md
Normal file
15
docs/api/rhi/d3d12/command-list/get-command-list.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12CommandList::GetCommandList
|
||||
|
||||
```cpp
|
||||
ID3D12GraphicsCommandList* GetCommandList() const { return m_commandList.Get(); }
|
||||
```
|
||||
|
||||
获取底层的 D3D12 图形命令列表接口。
|
||||
|
||||
**返回:** `ID3D12GraphicsCommandList*`
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/get-resource-state.md
Normal file
18
docs/api/rhi/d3d12/command-list/get-resource-state.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::GetResourceState
|
||||
|
||||
```cpp
|
||||
ResourceStates GetResourceState(ID3D12Resource* resource) const;
|
||||
```
|
||||
|
||||
获取资源状态。
|
||||
|
||||
**参数:**
|
||||
- `resource` - D3D12 资源指针
|
||||
|
||||
**返回:** 资源当前状态
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
21
docs/api/rhi/d3d12/command-list/resolve-query-data.md
Normal file
21
docs/api/rhi/d3d12/command-list/resolve-query-data.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# D3D12CommandList::ResolveQueryData
|
||||
|
||||
```cpp
|
||||
void ResolveQueryData(ID3D12QueryHeap* queryHeap, QueryType type, uint32_t startIndex, uint32_t count, ID3D12Resource* resultBuffer, uint64_t resultOffset);
|
||||
```
|
||||
|
||||
解析查询数据。
|
||||
|
||||
**参数:**
|
||||
- `queryHeap` - 查询堆
|
||||
- `type` - 查询类型
|
||||
- `startIndex` - 起始索引
|
||||
- `count` - 查询数量
|
||||
- `resultBuffer` - 结果缓冲区
|
||||
- `resultOffset` - 结果偏移
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/set-blend-factor.md
Normal file
16
docs/api/rhi/d3d12/command-list/set-blend-factor.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::SetBlendFactor
|
||||
|
||||
```cpp
|
||||
void SetBlendFactor(const float blendFactor[4]);
|
||||
```
|
||||
|
||||
设置混合因子。
|
||||
|
||||
**参数:**
|
||||
- `blendFactor` - 混合因子数组 [r, g, b, a]
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::SetComputeDescriptorTable
|
||||
|
||||
```cpp
|
||||
void SetComputeDescriptorTable(uint32_t rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE baseHandle);
|
||||
```
|
||||
|
||||
设置计算描述符表。
|
||||
|
||||
**参数:**
|
||||
- `rootParameterIndex` - 根参数索引
|
||||
- `baseHandle` - GPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/set-depth-bias.md
Normal file
18
docs/api/rhi/d3d12/command-list/set-depth-bias.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::SetDepthBias
|
||||
|
||||
```cpp
|
||||
void SetDepthBias(float depthBias, float slopeScaledDepthBias, float depthBiasClamp);
|
||||
```
|
||||
|
||||
设置深度偏移。
|
||||
|
||||
**参数:**
|
||||
- `depthBias` - 基础深度偏移
|
||||
- `slopeScaledDepthBias` - 斜率缩放深度偏移
|
||||
- `depthBiasClamp` - 深度偏移上限
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/set-descriptor-heap.md
Normal file
16
docs/api/rhi/d3d12/command-list/set-descriptor-heap.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::SetDescriptorHeap
|
||||
|
||||
```cpp
|
||||
void SetDescriptorHeap(ID3D12DescriptorHeap* heap);
|
||||
```
|
||||
|
||||
设置描述符堆。
|
||||
|
||||
**参数:**
|
||||
- `heap` - D3D12 描述符堆指针
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-list/set-descriptor-heaps.md
Normal file
17
docs/api/rhi/d3d12/command-list/set-descriptor-heaps.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::SetDescriptorHeaps
|
||||
|
||||
```cpp
|
||||
void SetDescriptorHeaps(uint32_t count, ID3D12DescriptorHeap** heaps);
|
||||
```
|
||||
|
||||
设置多个描述符堆。
|
||||
|
||||
**参数:**
|
||||
- `count` - 描述符堆数量
|
||||
- `heaps` - 描述符堆指针数组
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::SetGraphicsDescriptorTable
|
||||
|
||||
```cpp
|
||||
void SetGraphicsDescriptorTable(uint32_t rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE baseHandle);
|
||||
```
|
||||
|
||||
设置图形描述符表。
|
||||
|
||||
**参数:**
|
||||
- `rootParameterIndex` - 根参数索引
|
||||
- `baseHandle` - GPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,19 @@
|
||||
# D3D12CommandList::SetGraphicsRoot32BitConstants
|
||||
|
||||
```cpp
|
||||
void SetGraphicsRoot32BitConstants(uint32_t rootParameterIndex, uint32_t num32BitValuesToSet, const void* pSrcData, uint32_t destOffsetIn32BitValues);
|
||||
```
|
||||
|
||||
设置图形根 32 位常量。
|
||||
|
||||
**参数:**
|
||||
- `rootParameterIndex` - 根参数索引
|
||||
- `num32BitValuesToSet` - 要设置的 32 位值数量
|
||||
- `pSrcData` - 源数据指针
|
||||
- `destOffsetIn32BitValues` - 目标偏移量
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::SetGraphicsRootConstantBufferView
|
||||
|
||||
```cpp
|
||||
void SetGraphicsRootConstantBufferView(uint32_t rootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS bufferLocation);
|
||||
```
|
||||
|
||||
设置图形根常量缓冲区视图。
|
||||
|
||||
**参数:**
|
||||
- `rootParameterIndex` - 根参数索引
|
||||
- `bufferLocation` - GPU 虚拟地址
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::SetGraphicsRootDescriptorTable
|
||||
|
||||
```cpp
|
||||
void SetGraphicsRootDescriptorTable(uint32_t rootParameterIndex, D3D12_GPU_DESCRIPTOR_HANDLE baseDescriptor);
|
||||
```
|
||||
|
||||
设置图形根描述符表。
|
||||
|
||||
**参数:**
|
||||
- `rootParameterIndex` - 根参数索引
|
||||
- `baseDescriptor` - GPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::SetGraphicsRootShaderResourceView
|
||||
|
||||
```cpp
|
||||
void SetGraphicsRootShaderResourceView(uint32_t rootParameterIndex, D3D12_GPU_VIRTUAL_ADDRESS shaderResource);
|
||||
```
|
||||
|
||||
设置图形根着色器资源视图。
|
||||
|
||||
**参数:**
|
||||
- `rootParameterIndex` - 根参数索引
|
||||
- `shaderResource` - GPU 虚拟地址
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/set-index-buffer.md
Normal file
18
docs/api/rhi/d3d12/command-list/set-index-buffer.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::SetIndexBuffer
|
||||
|
||||
```cpp
|
||||
void SetIndexBuffer(void* buffer, uint64_t offset, Format format) override;
|
||||
```
|
||||
|
||||
设置索引缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `buffer` - 缓冲区指针
|
||||
- `offset` - 缓冲区偏移
|
||||
- `format` - 索引格式
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/set-pipeline-state.md
Normal file
16
docs/api/rhi/d3d12/command-list/set-pipeline-state.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::SetPipelineState
|
||||
|
||||
```cpp
|
||||
void SetPipelineState(void* pso) override;
|
||||
```
|
||||
|
||||
设置图形管线状态对象。
|
||||
|
||||
**参数:**
|
||||
- `pso` - 管线状态对象指针
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/set-primitive-topology.md
Normal file
16
docs/api/rhi/d3d12/command-list/set-primitive-topology.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::SetPrimitiveTopology
|
||||
|
||||
```cpp
|
||||
void SetPrimitiveTopology(PrimitiveTopology topology);
|
||||
```
|
||||
|
||||
设置图元拓扑类型。
|
||||
|
||||
**参数:**
|
||||
- `topology` - 图元拓扑类型
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/set-render-targets-handle.md
Normal file
18
docs/api/rhi/d3d12/command-list/set-render-targets-handle.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::SetRenderTargetsHandle
|
||||
|
||||
```cpp
|
||||
void SetRenderTargetsHandle(uint32_t count, const D3D12_CPU_DESCRIPTOR_HANDLE* renderTargetHandles, const D3D12_CPU_DESCRIPTOR_HANDLE* depthStencilHandle = nullptr);
|
||||
```
|
||||
|
||||
使用描述符句柄设置渲染目标。
|
||||
|
||||
**参数:**
|
||||
- `count` - 渲染目标数量
|
||||
- `renderTargetHandles` - 渲染目标描述符句柄数组
|
||||
- `depthStencilHandle` - 深度模板描述符句柄
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::SetRenderTargetsInternal
|
||||
|
||||
```cpp
|
||||
void SetRenderTargetsInternal(uint32_t count, ID3D12Resource** renderTargets, ID3D12Resource* depthStencil = nullptr);
|
||||
```
|
||||
|
||||
设置渲染目标(内部接口)。
|
||||
|
||||
**参数:**
|
||||
- `count` - 渲染目标数量
|
||||
- `renderTargets` - D3D12 资源指针数组
|
||||
- `depthStencil` - 深度模板资源指针
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/set-render-targets.md
Normal file
18
docs/api/rhi/d3d12/command-list/set-render-targets.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::SetRenderTargets
|
||||
|
||||
```cpp
|
||||
void SetRenderTargets(uint32_t count, void** renderTargets, void* depthStencil = nullptr) override;
|
||||
```
|
||||
|
||||
设置渲染目标。
|
||||
|
||||
**参数:**
|
||||
- `count` - 渲染目标数量
|
||||
- `renderTargets` - 渲染目标指针数组
|
||||
- `depthStencil` - 深度模板目标指针
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/set-root-signature.md
Normal file
16
docs/api/rhi/d3d12/command-list/set-root-signature.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::SetRootSignature
|
||||
|
||||
```cpp
|
||||
void SetRootSignature(ID3D12RootSignature* signature);
|
||||
```
|
||||
|
||||
设置根签名。
|
||||
|
||||
**参数:**
|
||||
- `signature` - D3D12 根签名指针
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/set-scissor-rect.md
Normal file
16
docs/api/rhi/d3d12/command-list/set-scissor-rect.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::SetScissorRect
|
||||
|
||||
```cpp
|
||||
void SetScissorRect(const Rect& rect) override;
|
||||
```
|
||||
|
||||
设置裁剪矩形。
|
||||
|
||||
**参数:**
|
||||
- `rect` - 裁剪矩形结构
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-list/set-scissor-rects.md
Normal file
17
docs/api/rhi/d3d12/command-list/set-scissor-rects.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::SetScissorRects
|
||||
|
||||
```cpp
|
||||
void SetScissorRects(uint32_t count, const Rect* rects) override;
|
||||
```
|
||||
|
||||
设置多个裁剪矩形。
|
||||
|
||||
**参数:**
|
||||
- `count` - 裁剪矩形数量
|
||||
- `rects` - 裁剪矩形数组
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/set-stencil-ref.md
Normal file
16
docs/api/rhi/d3d12/command-list/set-stencil-ref.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::SetStencilRef
|
||||
|
||||
```cpp
|
||||
void SetStencilRef(uint32_t stencilRef);
|
||||
```
|
||||
|
||||
设置模板参考值。
|
||||
|
||||
**参数:**
|
||||
- `stencilRef` - 模板参考值
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
19
docs/api/rhi/d3d12/command-list/set-vertex-buffer.md
Normal file
19
docs/api/rhi/d3d12/command-list/set-vertex-buffer.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12CommandList::SetVertexBuffer
|
||||
|
||||
```cpp
|
||||
void SetVertexBuffer(uint32_t slot, void* buffer, uint64_t offset, uint32_t stride) override;
|
||||
```
|
||||
|
||||
设置单个顶点缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `slot` - 顶点缓冲区槽位
|
||||
- `buffer` - 缓冲区指针
|
||||
- `offset` - 缓冲区偏移
|
||||
- `stride` - 顶点 stride
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
20
docs/api/rhi/d3d12/command-list/set-vertex-buffers.md
Normal file
20
docs/api/rhi/d3d12/command-list/set-vertex-buffers.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# D3D12CommandList::SetVertexBuffers
|
||||
|
||||
```cpp
|
||||
void SetVertexBuffers(uint32_t startSlot, uint32_t count, const uint64_t* buffers, const uint64_t* offsets, const uint32_t* strides) override;
|
||||
```
|
||||
|
||||
设置多个顶点缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `startSlot` - 起始槽位
|
||||
- `count` - 缓冲区数量
|
||||
- `buffers` - 缓冲区指针数组
|
||||
- `offsets` - 偏移数组
|
||||
- `strides` - stride 数组
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/set-viewport.md
Normal file
16
docs/api/rhi/d3d12/command-list/set-viewport.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::SetViewport
|
||||
|
||||
```cpp
|
||||
void SetViewport(const Viewport& viewport) override;
|
||||
```
|
||||
|
||||
设置视口。
|
||||
|
||||
**参数:**
|
||||
- `viewport` - 视口结构
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-list/set-viewports.md
Normal file
17
docs/api/rhi/d3d12/command-list/set-viewports.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandList::SetViewports
|
||||
|
||||
```cpp
|
||||
void SetViewports(uint32_t count, const Viewport* viewports) override;
|
||||
```
|
||||
|
||||
设置多个视口。
|
||||
|
||||
**参数:**
|
||||
- `count` - 视口数量
|
||||
- `viewports` - 视口数组
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/track-resource.md
Normal file
16
docs/api/rhi/d3d12/command-list/track-resource.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::TrackResource
|
||||
|
||||
```cpp
|
||||
void TrackResource(ID3D12Resource* resource);
|
||||
```
|
||||
|
||||
跟踪资源状态。
|
||||
|
||||
**参数:**
|
||||
- `resource` - D3D12 资源指针
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
@@ -0,0 +1,19 @@
|
||||
# D3D12CommandList::TransitionBarrierInternal
|
||||
|
||||
```cpp
|
||||
void TransitionBarrierInternal(ID3D12Resource* resource, ResourceStates stateBefore, ResourceStates stateAfter, uint32_t subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES);
|
||||
```
|
||||
|
||||
为资源添加转换屏障(内部接口)。
|
||||
|
||||
**参数:**
|
||||
- `resource` - D3D12 资源指针
|
||||
- `stateBefore` - 转换前的资源状态
|
||||
- `stateAfter` - 转换后的资源状态
|
||||
- `subresource` - 子资源索引,默认为所有子资源
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/command-list/transition-barrier.md
Normal file
18
docs/api/rhi/d3d12/command-list/transition-barrier.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12CommandList::TransitionBarrier
|
||||
|
||||
```cpp
|
||||
void TransitionBarrier(void* resource, ResourceStates stateBefore, ResourceStates stateAfter) override;
|
||||
```
|
||||
|
||||
为资源添加转换屏障。
|
||||
|
||||
**参数:**
|
||||
- `resource` - 目标资源指针
|
||||
- `stateBefore` - 转换前的资源状态
|
||||
- `stateAfter` - 转换后的资源状态
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
16
docs/api/rhi/d3d12/command-list/uav-barrier.md
Normal file
16
docs/api/rhi/d3d12/command-list/uav-barrier.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12CommandList::UAVBarrier
|
||||
|
||||
```cpp
|
||||
void UAVBarrier(void* resource = nullptr);
|
||||
```
|
||||
|
||||
添加无序访问视图屏障。
|
||||
|
||||
**参数:**
|
||||
- `resource` - 目标资源指针,nullptr 表示所有 UAV
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandList 总览](command-list.md) - 返回类总览
|
||||
26
docs/api/rhi/d3d12/command-queue/command-queue.md
Normal file
26
docs/api/rhi/d3d12/command-queue/command-queue.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# D3D12CommandQueue
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 命令队列的 D3D12 实现,继承自 `RHICommandQueue`。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](../../../threading/task-system/initialize.md) | 初始化命令队列 |
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭命令队列 |
|
||||
| [`ExecuteCommandLists`](execute-command-lists.md) | 执行命令列表 |
|
||||
| [`Signal`](signal.md) | 信号栅栏 |
|
||||
| [`Wait`](../../../threading/task-group/wait.md) | 等待栅栏 |
|
||||
| [`GetCompletedValue`](get-completed-value.md) | 获取完成值 |
|
||||
| [`WaitForIdle`](wait-for-idle.md) | 等待空闲 |
|
||||
| [`GetType`](../../command-queue/get-type.md) | 获取队列类型 |
|
||||
| [`GetTimestampFrequency`](get-timestamp-frequency.md) | 获取时间戳频率 |
|
||||
| [`GetCommandQueue`](get-command-queue.md) | 获取 D3D12 命令队列 |
|
||||
| [`GetNativeHandle`](../../buffer/get-native-handle.md) | 获取原生句柄 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
- [RHICommandQueue](../../command-queue/command-queue.md) - 抽象命令队列接口
|
||||
17
docs/api/rhi/d3d12/command-queue/execute-command-lists.md
Normal file
17
docs/api/rhi/d3d12/command-queue/execute-command-lists.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandQueue::ExecuteCommandLists
|
||||
|
||||
```cpp
|
||||
void ExecuteCommandLists(uint32_t count, void** lists) override;
|
||||
```
|
||||
|
||||
执行命令列表。
|
||||
|
||||
**参数:**
|
||||
- `count` - 命令列表数量
|
||||
- `lists` - 命令列表指针数组
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandQueue 总览](command-queue.md) - 返回类总览
|
||||
15
docs/api/rhi/d3d12/command-queue/get-command-queue.md
Normal file
15
docs/api/rhi/d3d12/command-queue/get-command-queue.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12CommandQueue::GetCommandQueue
|
||||
|
||||
```cpp
|
||||
ID3D12CommandQueue* GetCommandQueue() const { return m_commandQueue.Get(); }
|
||||
```
|
||||
|
||||
获取底层 D3D12 命令队列接口。
|
||||
|
||||
**返回:** `ID3D12CommandQueue*`
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandQueue 总览](command-queue.md) - 返回类总览
|
||||
15
docs/api/rhi/d3d12/command-queue/get-completed-value.md
Normal file
15
docs/api/rhi/d3d12/command-queue/get-completed-value.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12CommandQueue::GetCompletedValue
|
||||
|
||||
```cpp
|
||||
uint64_t GetCompletedValue() override;
|
||||
```
|
||||
|
||||
获取已完成值。
|
||||
|
||||
**返回:** 栅栏已完成的值
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandQueue 总览](command-queue.md) - 返回类总览
|
||||
15
docs/api/rhi/d3d12/command-queue/get-timestamp-frequency.md
Normal file
15
docs/api/rhi/d3d12/command-queue/get-timestamp-frequency.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12CommandQueue::GetTimestampFrequency
|
||||
|
||||
```cpp
|
||||
uint64_t GetTimestampFrequency() const override { return m_timestampFrequency; }
|
||||
```
|
||||
|
||||
获取时间戳频率。
|
||||
|
||||
**返回:** 时间戳频率
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandQueue 总览](command-queue.md) - 返回类总览
|
||||
17
docs/api/rhi/d3d12/command-queue/signal.md
Normal file
17
docs/api/rhi/d3d12/command-queue/signal.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12CommandQueue::Signal
|
||||
|
||||
```cpp
|
||||
void Signal(RHIFence* fence, uint64_t value) override;
|
||||
```
|
||||
|
||||
发送信号。
|
||||
|
||||
**参数:**
|
||||
- `fence` - 栅栏指针
|
||||
- `value` - 信号值
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandQueue 总览](command-queue.md) - 返回类总览
|
||||
13
docs/api/rhi/d3d12/command-queue/wait-for-idle.md
Normal file
13
docs/api/rhi/d3d12/command-queue/wait-for-idle.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12CommandQueue::WaitForIdle
|
||||
|
||||
```cpp
|
||||
void WaitForIdle() override;
|
||||
```
|
||||
|
||||
等待空闲。
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12CommandQueue 总览](command-queue.md) - 返回类总览
|
||||
67
docs/api/rhi/d3d12/common/common.md
Normal file
67
docs/api/rhi/d3d12/common/common.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# D3D12Common
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: D3D12 通用辅助函数集合,提供描述符大小、屏障创建、格式支持检查等功能。**所有函数均为 inline 函数**。
|
||||
|
||||
## 函数列表
|
||||
|
||||
### 描述符大小
|
||||
|
||||
| 函数 | 描述 |
|
||||
|------|------|
|
||||
| `GetDescriptorHandleIncrementSize` | 获取描述符增量大小 |
|
||||
| `GetRTVDescriptorSize` | 获取 RTV 描述符大小 |
|
||||
| `GetDSVDescriptorSize` | 获取 DSV 描述符大小 |
|
||||
| `GetCBV_SRV_UAVDescriptorSize` | 获取 CBV/SRV/UAV 描述符大小 |
|
||||
| `GetSamplerDescriptorSize` | 获取 Sampler 描述符大小 |
|
||||
|
||||
### 屏障创建
|
||||
|
||||
| 函数 | 描述 |
|
||||
|------|------|
|
||||
| `CreateTransitionBarrier` | 创建资源状态转换屏障 |
|
||||
| `CreateUAVBarrier` | 创建 UAV 屏障 |
|
||||
| `CreateAliasingBarrier` | 创建别名化屏障 |
|
||||
|
||||
### 格式支持
|
||||
|
||||
| 函数 | 描述 |
|
||||
|------|------|
|
||||
| `CheckFormatSupport` | 检查格式支持 |
|
||||
| `IsRenderTargetFormatSupported` | 检查是否支持作为渲染目标 |
|
||||
| `IsDepthStencilFormatSupported` | 检查是否支持作为深度模板 |
|
||||
| `IsShaderResourceFormatSupported` | 检查 shader 是否可读取 |
|
||||
| `IsTextureFormatSupported` | 检查是否支持作为纹理 |
|
||||
|
||||
### 清除值创建
|
||||
|
||||
| 函数 | 描述 |
|
||||
|------|------|
|
||||
| `CreateRenderTargetClearValue` | 创建渲染目标清除值 |
|
||||
| `CreateDepthStencilClearValue` | 创建深度模板清除值 |
|
||||
|
||||
### 视口和裁剪矩形
|
||||
|
||||
| 函数 | 描述 |
|
||||
|------|------|
|
||||
| `CreateViewport` | 创建视口 |
|
||||
| `CreateScissorRect` | 创建裁剪矩形 |
|
||||
|
||||
### 缓冲区视图
|
||||
|
||||
| 函数 | 描述 |
|
||||
|------|------|
|
||||
| `CreateVertexBufferView` | 创建顶点缓冲区视图 |
|
||||
| `CreateIndexBufferView` | 创建索引缓冲区视图 |
|
||||
|
||||
### 描述符句柄运算
|
||||
|
||||
| 函数 | 描述 |
|
||||
|------|------|
|
||||
| `GetCPUDescriptorHandle` | 计算偏移后的 CPU 描述符句柄 |
|
||||
| `GetGPUDescriptorHandle` | 计算偏移后的 GPU 描述符句柄 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
@@ -0,0 +1,17 @@
|
||||
# D3D12ConstantBufferView
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 常量缓冲区视图的 D3D12 实现。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](../../../threading/task-system/initialize.md) | 初始化常量缓冲区视图 |
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭常量缓冲区视图 |
|
||||
| [`GetCPUDescriptorHandle`](get-cpu-descriptor-handle.md) | 获取 CPU 描述符句柄 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
@@ -0,0 +1,15 @@
|
||||
# D3D12ConstantBufferView::GetCPUDescriptorHandle
|
||||
|
||||
```cpp
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
```
|
||||
|
||||
获取 CPU 描述符句柄。
|
||||
|
||||
**返回:** CPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12ConstantBufferView 总览](constant-buffer-view.md) - 返回类总览
|
||||
77
docs/api/rhi/d3d12/d3d12.md
Normal file
77
docs/api/rhi/d3d12/d3d12.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# D3D12 后端概览
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**类型**: `module`
|
||||
|
||||
**描述**: DirectX 12 后端实现模块,提供对 DirectX 12 API 的完整封装。
|
||||
|
||||
## 组件列表
|
||||
|
||||
### 核心组件
|
||||
|
||||
| 组件 | 文档 |
|
||||
|------|------|
|
||||
| [D3D12Device](device/device.md) | DirectX 12 设备实现 |
|
||||
| [D3D12CommandList](command-list/command-list.md) | 命令列表实现 |
|
||||
|
||||
### 资源类型
|
||||
|
||||
| 组件 | 文档 |
|
||||
|------|------|
|
||||
| [D3D12Buffer](buffer/buffer.md) | GPU 缓冲区实现 |
|
||||
| [D3D12Texture](texture/texture.md) | GPU 纹理实现 |
|
||||
|
||||
### 命令执行
|
||||
|
||||
| 组件 | 文档 |
|
||||
|------|------|
|
||||
| [D3D12CommandQueue](command-queue/command-queue.md) | 命令队列实现 |
|
||||
| [D3D12CommandAllocator](command-allocator/command-allocator.md) | 命令分配器 |
|
||||
|
||||
### 同步原语
|
||||
|
||||
| 组件 | 文档 |
|
||||
|------|------|
|
||||
| [D3D12Fence](fence/fence.md) | 同步栅栏实现 |
|
||||
| [D3D12SwapChain](swap-chain/swap-chain.md) | 交换链实现 |
|
||||
|
||||
### 渲染状态
|
||||
|
||||
| 组件 | 文档 |
|
||||
|------|------|
|
||||
| [D3D12Shader](shader/shader.md) | 着色器实现 |
|
||||
| [D3D12PipelineState](pipeline-state/pipeline-state.md) | 管线状态对象 |
|
||||
| [D3D12Sampler](sampler/sampler.md) | 采样器实现 |
|
||||
| [D3D12RootSignature](root-signature/root-signature.md) | 根签名实现 |
|
||||
|
||||
### 描述符
|
||||
|
||||
| 组件 | 文档 |
|
||||
|------|------|
|
||||
| [D3D12DescriptorHeap](descriptor-heap/descriptor-heap.md) | 描述符堆实现 |
|
||||
| [D3D12RenderTargetView](render-target-view/render-target-view.md) | 渲染目标视图 |
|
||||
| [D3D12DepthStencilView](depth-stencil-view/depth-stencil-view.md) | 深度模板视图 |
|
||||
| [D3D12ShaderResourceView](shader-resource-view/shader-resource-view.md) | 着色器资源视图 |
|
||||
| [D3D12UnorderedAccessView](unordered-access-view/unordered-access-view.md) | 无序访问视图 |
|
||||
| [D3D12ConstantBufferView](constant-buffer-view/constant-buffer-view.md) | 常量缓冲视图 |
|
||||
|
||||
### 查询
|
||||
|
||||
| 组件 | 文档 |
|
||||
|------|------|
|
||||
| [D3D12QueryHeap](query-heap/query-heap.md) | 查询堆实现 |
|
||||
|
||||
### 工具
|
||||
|
||||
| 组件 | 文档 |
|
||||
|------|------|
|
||||
| [D3D12Screenshot](screenshot/screenshot.md) | 截图工具 |
|
||||
| [D3D12Types](types/types.md) | D3D12 类型转换 |
|
||||
| [D3D12Enums](enums/enums.md) | D3D12 枚举转换 |
|
||||
| [D3D12Common](common/common.md) | D3D12 公共工具函数 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [../rhi/rhi.md](../rhi.md) - RHI 模块总览
|
||||
- [OpenGL 后端](../opengl/overview.md)
|
||||
19
docs/api/rhi/d3d12/depth-stencil-view/create-desc.md
Normal file
19
docs/api/rhi/d3d12/depth-stencil-view/create-desc.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12DepthStencilView::CreateDesc
|
||||
|
||||
```cpp
|
||||
static D3D12_DEPTH_STENCIL_VIEW_DESC CreateDesc(Format format, D3D12_DSV_DIMENSION dimension = D3D12_DSV_DIMENSION_TEXTURE2D);
|
||||
```
|
||||
|
||||
创建深度模板视图描述(静态方法)。
|
||||
|
||||
**参数:**
|
||||
- `format` - 格式
|
||||
- `dimension` - 视图维度
|
||||
|
||||
**返回:** D3D12 深度模板视图描述
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DepthStencilView 总览](depth-stencil-view.md) - 返回类总览
|
||||
19
docs/api/rhi/d3d12/depth-stencil-view/depth-stencil-view.md
Normal file
19
docs/api/rhi/d3d12/depth-stencil-view/depth-stencil-view.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12DepthStencilView
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 深度模板视图的 D3D12 实现。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](../../../threading/task-system/initialize.md) | 初始化深度模板视图 |
|
||||
| [`InitializeAt`](initialize-at.md) | 在指定位置初始化 |
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭深度模板视图 |
|
||||
| [`GetCPUDescriptorHandle`](get-cpu-descriptor-handle.md) | 获取 CPU 描述符句柄 |
|
||||
| [`CreateDesc`](create-desc.md) | 创建描述符(静态) |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
@@ -0,0 +1,15 @@
|
||||
# D3D12DepthStencilView::GetCPUDescriptorHandle
|
||||
|
||||
```cpp
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() const { return m_handle; }
|
||||
```
|
||||
|
||||
获取 CPU 描述符句柄。
|
||||
|
||||
**返回:** CPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DepthStencilView 总览](depth-stencil-view.md) - 返回类总览
|
||||
19
docs/api/rhi/d3d12/depth-stencil-view/initialize-at.md
Normal file
19
docs/api/rhi/d3d12/depth-stencil-view/initialize-at.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12DepthStencilView::InitializeAt
|
||||
|
||||
```cpp
|
||||
void InitializeAt(ID3D12Device* device, ID3D12Resource* resource, D3D12_CPU_DESCRIPTOR_HANDLE handle, const D3D12_DEPTH_STENCIL_VIEW_DESC* desc = nullptr);
|
||||
```
|
||||
|
||||
在指定位置初始化深度模板视图。
|
||||
|
||||
**参数:**
|
||||
- `device` - D3D12 设备
|
||||
- `resource` - D3D12 资源
|
||||
- `handle` - CPU 描述符句柄
|
||||
- `desc` - 深度模板视图描述
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DepthStencilView 总览](depth-stencil-view.md) - 返回类总览
|
||||
20
docs/api/rhi/d3d12/descriptor-heap/create-desc.md
Normal file
20
docs/api/rhi/d3d12/descriptor-heap/create-desc.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# D3D12DescriptorHeap::CreateDesc
|
||||
|
||||
```cpp
|
||||
static D3D12_DESCRIPTOR_HEAP_DESC CreateDesc(DescriptorHeapType type, uint32_t numDescriptors, bool shaderVisible = false);
|
||||
```
|
||||
|
||||
创建描述符堆描述(静态方法)。
|
||||
|
||||
**参数:**
|
||||
- `type` - 描述符堆类型
|
||||
- `numDescriptors` - 描述符数量
|
||||
- `shaderVisible` - 是否对 Shader 可见
|
||||
|
||||
**返回:** D3D12 描述符堆描述
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
27
docs/api/rhi/d3d12/descriptor-heap/descriptor-heap.md
Normal file
27
docs/api/rhi/d3d12/descriptor-heap/descriptor-heap.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# D3D12DescriptorHeap
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 描述符堆的 D3D12 实现,继承自 `RHIDescriptorPool`。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](initialize-from-desc.md) | 从描述符初始化 |
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭描述符堆 |
|
||||
| [`GetDescriptorHeap`](get-descriptor-heap.md) | 获取 D3D12 描述符堆 |
|
||||
| [`GetCPUDescriptorHandle`](get-cpu-descriptor-handle.md) | 获取 CPU 描述符句柄 |
|
||||
| [`GetGPUDescriptorHandle`](get-gpu-descriptor-handle.md) | 获取 GPU 描述符句柄 |
|
||||
| [`GetDescriptorCount`](get-descriptor-count.md) | 获取描述符数量 |
|
||||
| [`GetType`](../../command-queue/get-type.md) | 获取描述符类型 |
|
||||
| [`GetDescriptorSize`](get-descriptor-size.md) | 获取描述符大小 |
|
||||
| [`GetCPUDescriptorHandleForHeapStart`](get-cpu-descriptor-handle-for-heap-start.md) | 获取堆起始 CPU 句柄 |
|
||||
| [`GetGPUDescriptorHandleForHeapStart`](get-gpu-descriptor-handle-for-heap-start.md) | 获取堆起始 GPU 句柄 |
|
||||
| [`GetNativeHandle`](../../buffer/get-native-handle.md) | 获取原生句柄 |
|
||||
| [`CreateDesc`](create-desc.md) | 创建描述符(静态) |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
- [RHIDescriptorPool](../../descriptor-pool/descriptor-pool.md) - 抽象描述符池接口
|
||||
@@ -0,0 +1,15 @@
|
||||
# D3D12DescriptorHeap::GetCPUDescriptorHandleForHeapStart
|
||||
|
||||
```cpp
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandleForHeapStart() const;
|
||||
```
|
||||
|
||||
获取堆起始处的 CPU 描述符句柄。
|
||||
|
||||
**返回:** CPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
@@ -0,0 +1,18 @@
|
||||
# D3D12DescriptorHeap::GetCPUDescriptorHandle
|
||||
|
||||
```cpp
|
||||
CPUDescriptorHandle GetCPUDescriptorHandle(uint32_t index);
|
||||
```
|
||||
|
||||
获取 CPU 描述符句柄。
|
||||
|
||||
**参数:**
|
||||
- `index` - 描述符索引
|
||||
|
||||
**返回:** CPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
15
docs/api/rhi/d3d12/descriptor-heap/get-descriptor-count.md
Normal file
15
docs/api/rhi/d3d12/descriptor-heap/get-descriptor-count.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12DescriptorHeap::GetDescriptorCount
|
||||
|
||||
```cpp
|
||||
uint32_t GetDescriptorCount() const override;
|
||||
```
|
||||
|
||||
获取描述符数量。
|
||||
|
||||
**返回:** 描述符数量
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
15
docs/api/rhi/d3d12/descriptor-heap/get-descriptor-heap.md
Normal file
15
docs/api/rhi/d3d12/descriptor-heap/get-descriptor-heap.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12DescriptorHeap::GetDescriptorHeap
|
||||
|
||||
```cpp
|
||||
ID3D12DescriptorHeap* GetDescriptorHeap() const { return m_descriptorHeap.Get(); }
|
||||
```
|
||||
|
||||
获取底层 D3D12 描述符堆接口。
|
||||
|
||||
**返回:** `ID3D12DescriptorHeap*`
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
15
docs/api/rhi/d3d12/descriptor-heap/get-descriptor-size.md
Normal file
15
docs/api/rhi/d3d12/descriptor-heap/get-descriptor-size.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12DescriptorHeap::GetDescriptorSize
|
||||
|
||||
```cpp
|
||||
uint32_t GetDescriptorSize() const { return m_descriptorSize; }
|
||||
```
|
||||
|
||||
获取描述符大小。
|
||||
|
||||
**返回:** 描述符大小(字节)
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
@@ -0,0 +1,15 @@
|
||||
# D3D12DescriptorHeap::GetGPUDescriptorHandleForHeapStart
|
||||
|
||||
```cpp
|
||||
D3D12_GPU_DESCRIPTOR_HANDLE GetGPUDescriptorHandleForHeapStart() const;
|
||||
```
|
||||
|
||||
获取堆起始处的 GPU 描述符句柄。
|
||||
|
||||
**返回:** GPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
@@ -0,0 +1,18 @@
|
||||
# D3D12DescriptorHeap::GetGPUDescriptorHandle
|
||||
|
||||
```cpp
|
||||
GPUDescriptorHandle GetGPUDescriptorHandle(uint32_t index);
|
||||
```
|
||||
|
||||
获取 GPU 描述符句柄。
|
||||
|
||||
**参数:**
|
||||
- `index` - 描述符索引
|
||||
|
||||
**返回:** GPU 描述符句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
18
docs/api/rhi/d3d12/descriptor-heap/initialize-from-desc.md
Normal file
18
docs/api/rhi/d3d12/descriptor-heap/initialize-from-desc.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12DescriptorHeap::InitializeFromDesc
|
||||
|
||||
```cpp
|
||||
bool Initialize(const DescriptorPoolDesc& desc) override;
|
||||
```
|
||||
|
||||
从描述符初始化。
|
||||
|
||||
**参数:**
|
||||
- `desc` - 描述符池描述
|
||||
|
||||
**返回:** 是否初始化成功
|
||||
|
||||
**复杂度:** O(n)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12DescriptorHeap 总览](descriptor-heap.md) - 返回类总览
|
||||
25
docs/api/rhi/d3d12/device/check-feature-support.md
Normal file
25
docs/api/rhi/d3d12/device/check-feature-support.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# D3D12Device::CheckFeatureSupport
|
||||
|
||||
```cpp
|
||||
bool CheckFeatureSupport(D3D12_FEATURE feature, void* featureSupportData, uint32_t featureSupportDataSize)
|
||||
```
|
||||
|
||||
检查特性支持。
|
||||
|
||||
**参数:**
|
||||
- `feature` - 特性类型
|
||||
- `featureSupportData` - 特性支持数据缓冲区
|
||||
- `featureSupportDataSize` - 数据大小
|
||||
|
||||
**返回:** 是否支持该特性
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS options;
|
||||
bool supported = d3d12Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(options));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](device.md) - 返回类总览
|
||||
35
docs/api/rhi/d3d12/device/device.md
Normal file
35
docs/api/rhi/d3d12/device/device.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# D3D12Device
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: DirectX 12 设备实现,继承自 `RHIDevice`。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](../../../threading/task-system/initialize.md) | 初始化设备 |
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭设备 |
|
||||
| [`CreateBuffer`](../../device/create-buffer.md) | 创建缓冲区 |
|
||||
| [`CreateTexture`](../../device/create-texture.md) | 创建纹理 |
|
||||
| [`CreateSwapChain`](../../device/create-swap-chain.md) | 创建交换链 |
|
||||
| [`CreateCommandList`](../../device/create-command-list.md) | 创建命令列表 |
|
||||
| [`CreateCommandQueue`](../../device/create-command-queue.md) | 创建命令队列 |
|
||||
| [`CompileShader`](../../device/compile-shader.md) | 编译着色器 |
|
||||
| [`CreatePipelineState`](../../device/create-pipeline-state.md) | 创建管线状态 |
|
||||
| [`CreateFence`](../../device/create-fence.md) | 创建栅栏 |
|
||||
| [`CreateSampler`](../../device/create-sampler.md) | 创建采样器 |
|
||||
| [`GetCapabilities`](../../device/get-capabilities.md) | 获取设备能力 |
|
||||
| [`GetDeviceInfo`](../../device/get-device-info.md) | 获取设备信息 |
|
||||
| [`GetNativeDevice`](../../device/get-native-device.md) | 获取原生设备 |
|
||||
| [`GetDevice`](get-device.md) | 获取 D3D12 设备 |
|
||||
| [`GetFactory`](get-factory.md) | 获取 D3D12 工厂 |
|
||||
| [`GetAdapterInfo`](get-adapter-info.md) | 获取适配器信息 |
|
||||
| [`EnumerateAdapters`](enumerate-adapters.md) | 枚举适配器 |
|
||||
| [`GetDescriptorHandleIncrementSize`](get-descriptor-handle-increment-size.md) | 获取描述符增量大小 |
|
||||
| [`CheckFeatureSupport`](check-feature-support.md) | 检查特性支持 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../../opengl/overview.md)
|
||||
- [RHIDevice](../../device/device.md) - 抽象设备接口
|
||||
22
docs/api/rhi/d3d12/device/enumerate-adapters.md
Normal file
22
docs/api/rhi/d3d12/device/enumerate-adapters.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# D3D12Device::EnumerateAdapters
|
||||
|
||||
```cpp
|
||||
std::vector<AdapterInfo> EnumerateAdapters()
|
||||
```
|
||||
|
||||
枚举所有可用的图形适配器。
|
||||
|
||||
**返回:** 适配器信息列表
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
std::vector<AdapterInfo> adapters = d3d12Device->EnumerateAdapters();
|
||||
for (const auto& adapter : adapters) {
|
||||
wprintf(L"Adapter: %ls\n", adapter.description.c_str());
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](device.md) - 返回类总览
|
||||
20
docs/api/rhi/d3d12/device/get-adapter-info.md
Normal file
20
docs/api/rhi/d3d12/device/get-adapter-info.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# D3D12Device::GetAdapterInfo
|
||||
|
||||
```cpp
|
||||
const AdapterInfo& GetAdapterInfo() const
|
||||
```
|
||||
|
||||
获取适配器信息。
|
||||
|
||||
**返回:** 适配器信息结构体引用
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
const AdapterInfo& info = d3d12Device->GetAdapterInfo();
|
||||
wprintf(L"GPU: %ls\n", info.description.c_str());
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](device.md) - 返回类总览
|
||||
@@ -0,0 +1,22 @@
|
||||
# D3D12Device::GetDescriptorHandleIncrementSize
|
||||
|
||||
```cpp
|
||||
UINT GetDescriptorHandleIncrementSize(DescriptorHeapType type) const
|
||||
```
|
||||
|
||||
获取描述符句柄增量大小。
|
||||
|
||||
**参数:**
|
||||
- `type` - 描述符堆类型
|
||||
|
||||
**返回:** 描述符句柄增量大小(字节)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
UINT size = d3d12Device->GetDescriptorHandleIncrementSize(DescriptorHeapType::CBV_SRV_UAV);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](device.md) - 返回类总览
|
||||
19
docs/api/rhi/d3d12/device/get-device.md
Normal file
19
docs/api/rhi/d3d12/device/get-device.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Device::GetDevice
|
||||
|
||||
```cpp
|
||||
ID3D12Device* GetDevice() const
|
||||
```
|
||||
|
||||
获取底层 D3D12 设备指针。
|
||||
|
||||
**返回:** DirectX 12 设备指针
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
ID3D12Device* device = d3d12Device->GetDevice();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](device.md) - 返回类总览
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user