refactor(docs): D3D12模块文档重构 - 修复链接错误并新增Buffer/Texture/SwapChain方法文档
- 新增32个方法文档(D3D12Buffer 13个,D3D12Texture 12个,D3D12SwapChain 6个) - 修复11处跨模块引用错误(rhi-device.md, rhi-texture.md等路径错误) - 清理d3d12-overview.md移除不存在的类引用 - 修复D3D12Device/D3D12CommandList/D3D12CommandQueue方法列表 - D3D12模块现无broken links
This commit is contained in:
13
docs/api/d3d12/d3d12-buffer-get-desc.md
Normal file
13
docs/api/d3d12/d3d12-buffer-get-desc.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Buffer::GetDesc
|
||||
|
||||
获取 D3D12 资源描述结构。
|
||||
|
||||
```cpp
|
||||
D3D12_RESOURCE_DESC GetDesc() const;
|
||||
```
|
||||
|
||||
**返回:** `D3D12_RESOURCE_DESC` - D3D12 资源描述结构
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
13
docs/api/d3d12/d3d12-buffer-get-gpu-virtual-address.md
Normal file
13
docs/api/d3d12/d3d12-buffer-get-gpu-virtual-address.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Buffer::GetGPUVirtualAddress
|
||||
|
||||
获取缓冲区的 GPU 虚拟地址。
|
||||
|
||||
```cpp
|
||||
D3D12_GPU_VIRTUAL_ADDRESS GetGPUVirtualAddress() const;
|
||||
```
|
||||
|
||||
**返回:** `D3D12_GPU_VIRTUAL_ADDRESS` - GPU 虚拟地址
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
13
docs/api/d3d12/d3d12-buffer-get-resource.md
Normal file
13
docs/api/d3d12/d3d12-buffer-get-resource.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Buffer::GetResource
|
||||
|
||||
获取底层 D3D12 资源指针。
|
||||
|
||||
```cpp
|
||||
ID3D12Resource* GetResource() const;
|
||||
```
|
||||
|
||||
**返回:** `ID3D12Resource*` - 底层 D3D12 资源指针
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
13
docs/api/d3d12/d3d12-buffer-get-state.md
Normal file
13
docs/api/d3d12/d3d12-buffer-get-state.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Buffer::GetState
|
||||
|
||||
获取缓冲区当前资源状态。
|
||||
|
||||
```cpp
|
||||
ResourceStates GetState() const;
|
||||
```
|
||||
|
||||
**返回:** `ResourceStates` - 当前资源状态
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
16
docs/api/d3d12/d3d12-buffer-initialize-from-existing.md
Normal file
16
docs/api/d3d12/d3d12-buffer-initialize-from-existing.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12Buffer::InitializeFromExisting
|
||||
|
||||
从现有的 D3D12 资源初始化缓冲区。
|
||||
|
||||
```cpp
|
||||
bool InitializeFromExisting(ID3D12Resource* resource);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `resource` - 已存在的 D3D12 资源指针
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true,失败返回 false
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
20
docs/api/d3d12/d3d12-buffer-initialize-with-data.md
Normal file
20
docs/api/d3d12/d3d12-buffer-initialize-with-data.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# D3D12Buffer::InitializeWithData
|
||||
|
||||
初始化缓冲区并从现有数据上传。
|
||||
|
||||
```cpp
|
||||
bool InitializeWithData(ID3D12Device* device, ID3D12GraphicsCommandList* commandList, const void* data, uint64_t size, D3D12_RESOURCE_STATES finalState);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `device` - DirectX 12 设备指针
|
||||
- `commandList` - 用于上传命令的命令列表
|
||||
- `data` - 要上传的数据指针
|
||||
- `size` - 数据大小(字节)
|
||||
- `finalState` - 上传完成后的目标资源状态
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true,失败返回 false
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
19
docs/api/d3d12/d3d12-buffer-initialize.md
Normal file
19
docs/api/d3d12/d3d12-buffer-initialize.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Buffer::Initialize
|
||||
|
||||
初始化 D3D12Buffer 缓冲区资源。
|
||||
|
||||
```cpp
|
||||
bool Initialize(ID3D12Device* device, uint64_t size, D3D12_RESOURCE_STATES initialState = D3D12_RESOURCE_STATE_COMMON, D3D12_HEAP_TYPE heapType = D3D12_HEAP_TYPE_DEFAULT);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `device` - DirectX 12 设备指针
|
||||
- `size` - 缓冲区大小(字节)
|
||||
- `initialState` - 初始资源状态,默认为 Common 状态
|
||||
- `heapType` - 堆类型,默认为默认堆(D3D12_HEAP_TYPE_DEFAULT)
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true,失败返回 false
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
13
docs/api/d3d12/d3d12-buffer-map.md
Normal file
13
docs/api/d3d12/d3d12-buffer-map.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Buffer::Map
|
||||
|
||||
映射缓冲区内存到 CPU 可访问地址。
|
||||
|
||||
```cpp
|
||||
void* Map() override;
|
||||
```
|
||||
|
||||
**返回:** `void*` - 映射后的内存指针
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
16
docs/api/d3d12/d3d12-buffer-set-data.md
Normal file
16
docs/api/d3d12/d3d12-buffer-set-data.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# D3D12Buffer::SetData
|
||||
|
||||
设置缓冲区数据。
|
||||
|
||||
```cpp
|
||||
void SetData(const void* data, size_t size, size_t offset = 0) override;
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `data` - 数据指针
|
||||
- `size` - 数据大小(字节)
|
||||
- `offset` - 缓冲区内的偏移量
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
14
docs/api/d3d12/d3d12-buffer-set-state.md
Normal file
14
docs/api/d3d12/d3d12-buffer-set-state.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# D3D12Buffer::SetState
|
||||
|
||||
设置缓冲区资源状态。
|
||||
|
||||
```cpp
|
||||
void SetState(ResourceStates state);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `state` - 目标资源状态
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
11
docs/api/d3d12/d3d12-buffer-shutdown.md
Normal file
11
docs/api/d3d12/d3d12-buffer-shutdown.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# D3D12Buffer::Shutdown
|
||||
|
||||
关闭缓冲区并释放相关资源。
|
||||
|
||||
```cpp
|
||||
void Shutdown() override;
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
11
docs/api/d3d12/d3d12-buffer-unmap.md
Normal file
11
docs/api/d3d12/d3d12-buffer-unmap.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# D3D12Buffer::Unmap
|
||||
|
||||
取消缓冲区内存映射。
|
||||
|
||||
```cpp
|
||||
void Unmap() override;
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
15
docs/api/d3d12/d3d12-buffer-update-data.md
Normal file
15
docs/api/d3d12/d3d12-buffer-update-data.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12Buffer::UpdateData
|
||||
|
||||
更新缓冲区数据。
|
||||
|
||||
```cpp
|
||||
void UpdateData(const void* data, uint64_t size);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `data` - 新数据指针
|
||||
- `size` - 数据大小(字节)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Buffer 总览](d3d12-buffer.md)
|
||||
@@ -35,4 +35,4 @@ D3D12Buffer 是 DirectX 12 缓冲区资源的封装类,继承自 RHIBuffer 接
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 模块概览](d3d12.md) - D3D12 模块总览
|
||||
- [RHIBuffer](../rhi-buffer.md) - RHI 缓冲区基类
|
||||
- [RHIBuffer](../rhi/buffer/buffer.md) - RHI 缓冲区基类
|
||||
|
||||
@@ -24,41 +24,14 @@ D3D12CommandList 是 DirectX 12 命令列表的封装类,继承自 RHICommandL
|
||||
| [Shutdown](d3d12-command-list-shutdown.md) | 关闭命令列表 |
|
||||
| [Reset](d3d12-command-list-reset.md) | 重置命令列表 |
|
||||
| [Close](d3d12-command-list-close.md) | 关闭命令列表 |
|
||||
| [GetCommandList](d3d12-command-list-get-command-list.md) | 获取底层命令列表指针 |
|
||||
| [TransitionBarrier](d3d12-command-list-transition-barrier.md) | 设置资源转换屏障 |
|
||||
| [UAVBarrier](d3d12-command-list-uav-barrier.md) | 设置 UAV 屏障 |
|
||||
| [AliasBarrier](d3d12-command-list-alias-barrier.md) | 设置别名屏障 |
|
||||
| [SetPipelineState](d3d12-command-list-set-pipeline-state.md) | 设置管道状态 |
|
||||
| [SetViewport](d3d12-command-list-set-viewport.md) | 设置视口 |
|
||||
| [SetViewports](d3d12-command-list-set-viewports.md) | 设置多个视口 |
|
||||
| [SetScissorRect](d3d12-command-list-set-scissor-rect.md) | 设置裁剪矩形 |
|
||||
| [SetScissorRects](d3d12-command-list-set-scissor-rects.md) | 设置多个裁剪矩形 |
|
||||
| [SetPrimitiveTopology](d3d12-command-list-set-primitive-topology.md) | 设置图元拓扑 |
|
||||
| [SetRenderTargets](d3d12-command-list-set-render-targets.md) | 设置渲染目标 |
|
||||
| [SetVertexBuffer](d3d12-command-list-set-vertex-buffer.md) | 设置顶点缓冲区 |
|
||||
| [SetVertexBuffers](d3d12-command-list-set-vertex-buffers.md) | 设置多个顶点缓冲区 |
|
||||
| [SetIndexBuffer](d3d12-command-list-set-index-buffer.md) | 设置索引缓冲区 |
|
||||
| [SetStencilRef](d3d12-command-list-set-stencil-ref.md) | 设置模板参考值 |
|
||||
| [SetDepthStencilState](d3d12-command-list-set-depth-stencil-state.md) | 设置深度模板状态 |
|
||||
| [SetBlendState](d3d12-command-list-set-blend-state.md) | 设置混合状态 |
|
||||
| [SetBlendFactor](d3d12-command-list-set-blend-factor.md) | 设置混合因子 |
|
||||
| [SetDepthBias](d3d12-command-list-set-depth-bias.md) | 设置深度偏移 |
|
||||
| [Draw](d3d12-command-list-draw.md) | 绘制调用 |
|
||||
| [DrawIndexed](d3d12-command-list-draw-indexed.md) | 绘制索引图元 |
|
||||
| [DrawInstancedIndirect](d3d12-command-list-draw-instanced-indirect.md) | 间接实例绘制 |
|
||||
| [DrawIndexedInstancedIndirect](d3d12-command-list-draw-indexed-instanced-indirect.md) | 间接索引实例绘制 |
|
||||
| [Clear](d3d12-command-list-clear.md) | 清除缓冲区 |
|
||||
| [ClearRenderTarget](d3d12-command-list-clear-render-target.md) | 清除渲染目标 |
|
||||
| [ClearDepthStencil](d3d12-command-list-clear-depth-stencil.md) | 清除深度模板 |
|
||||
| [CopyResource](d3d12-command-list-copy-resource.md) | 复制资源 |
|
||||
| [CopyBuffer](d3d12-command-list-copy-buffer.md) | 复制缓冲区 |
|
||||
| [CopyTexture](d3d12-command-list-copy-texture.md) | 复制纹理 |
|
||||
| [BeginQuery](d3d12-command-list-begin-query.md) | 开始查询 |
|
||||
| [EndQuery](d3d12-command-list-end-query.md) | 结束查询 |
|
||||
| [ResolveQueryData](d3d12-command-list-resolve-query-data.md) | 解析查询数据 |
|
||||
| [Dispatch](d3d12-command-list-dispatch.md) | 分发计算任务 |
|
||||
| [DispatchIndirect](d3d12-command-list-dispatch-indirect.md) | 间接分发计算任务 |
|
||||
| [ExecuteBundle](d3d12-command-list-execute-bundle.md) | 执行命令束 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
@@ -108,5 +81,5 @@ commandQueue->ExecuteCommandListsInternal(1, &cmdList);
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 模块概览](d3d12.md) - D3D12 模块总览
|
||||
- [RHICommandList](../rhi-command-list.md) - RHI 命令列表基类
|
||||
- [RHICommandList](../rhi/command-list/command-list.md) - RHI 命令列表基类
|
||||
- [D3D12CommandQueue](d3d12-command-queue.md) - 命令队列
|
||||
|
||||
@@ -18,17 +18,6 @@ D3D12CommandQueue 是 DirectX 12 命令队列的封装类,继承自 RHICommand
|
||||
|------|------|
|
||||
| `D3D12CommandQueue()` | 默认构造函数 |
|
||||
| `~D3D12CommandQueue()` | 虚析构函数 |
|
||||
| [Initialize](d3d12-command-queue-initialize.md) | 初始化命令队列 |
|
||||
| [Shutdown](d3d12-command-queue-shutdown.md) | 关闭命令队列 |
|
||||
| [ExecuteCommandLists](d3d12-command-queue-execute-command-lists.md) | 执行命令列表 |
|
||||
| [Signal](d3d12-command-queue-signal.md) | 设置围栏信号 |
|
||||
| [Wait](d3d12-command-queue-wait.md) | 等待围栏 |
|
||||
| [GetCompletedValue](d3d12-command-queue-get-completed-value.md) | 获取已完成值 |
|
||||
| [WaitForIdle](d3d12-command-queue-wait-for-idle.md) | 等待空闲 |
|
||||
| [GetType](d3d12-command-queue-get-type.md) | 获取队列类型 |
|
||||
| [GetTimestampFrequency](d3d12-command-queue-get-timestamp-frequency.md) | 获取时间戳频率 |
|
||||
| [GetCommandQueue](d3d12-command-queue-get-command-queue.md) | 获取底层队列指针 |
|
||||
| [WaitForPreviousFrame](d3d12-command-queue-wait-for-previous-frame.md) | 等待前一帧完成 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
@@ -60,4 +49,3 @@ commandQueue.Shutdown();
|
||||
|
||||
- [D3D12 模块概览](d3d12.md) - D3D12 模块总览
|
||||
- [D3D12CommandList](d3d12-command-list.md) - 命令列表
|
||||
- [D3D12Fence](d3d12-fence.md) - 围栏同步
|
||||
|
||||
@@ -14,4 +14,3 @@ RHIShader* CompileShader(const ShaderCompileDesc& desc) override;
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](d3d12-device.md)
|
||||
- [D3D12Shader](d3d12-shader.md)
|
||||
|
||||
@@ -14,4 +14,3 @@ RHIFence* CreateFence(const FenceDesc& desc) override;
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](d3d12-device.md)
|
||||
- [D3D12Fence](d3d12-fence.md)
|
||||
|
||||
@@ -14,4 +14,3 @@ RHIPipelineState* CreatePipelineState(const PipelineStateDesc& desc) override;
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](d3d12-device.md)
|
||||
- [D3D12PipelineState](d3d12-pipeline-state.md)
|
||||
|
||||
@@ -14,4 +14,3 @@ RHISampler* CreateSampler(const SamplerDesc& desc) override;
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](d3d12-device.md)
|
||||
- [D3D12Sampler](d3d12-sampler.md)
|
||||
|
||||
@@ -59,17 +59,6 @@ D3D12Device 是 DirectX 12 的核心设备类,封装了 ID3D12Device 接口。
|
||||
| [GetDeviceInfo](d3d12-device-get-device-info.md) | 获取设备信息 |
|
||||
| [GetNativeDevice](d3d12-device-get-native-device.md) | 获取原生设备指针 |
|
||||
| [GetNativeHandle](d3d12-device-get-native-handle.md) | 获取原生句柄 |
|
||||
| [CreateCommandQueueImpl](d3d12-device-create-command-queue-impl.md) | 内部创建命令队列 |
|
||||
| [CreateCommandListImpl](d3d12-device-create-command-list-impl.md) | 内部创建命令列表 |
|
||||
| [CreateCommandAllocator](d3d12-device-create-command-allocator.md) | 内部创建命令分配器 |
|
||||
| [CreateDescriptorHeap](d3d12-device-create-descriptor-heap.md) | 内部创建描述符堆 |
|
||||
| [CreateQueryHeap](d3d12-device-create-query-heap.md) | 内部创建查询堆 |
|
||||
| [CreateRootSignature](d3d12-device-create-root-signature.md) | 内部创建根签名 |
|
||||
| [CreateRenderTargetView](d3d12-device-create-render-target-view.md) | 创建渲染目标视图 |
|
||||
| [CreateDepthStencilView](d3d12-device-create-depth-stencil-view.md) | 创建深度模板视图 |
|
||||
| [CreateShaderResourceView](d3d12-device-create-shader-resource-view.md) | 创建着色器资源视图 |
|
||||
| [CreateUnorderedAccessView](d3d12-device-create-unordered-access-view.md) | 创建无序访问视图 |
|
||||
| [CreateConstantBufferView](d3d12-device-create-constant-buffer-view.md) | 创建常量缓冲区视图 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
@@ -128,6 +117,6 @@ device.Shutdown();
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 模块概览](d3d12.md) - D3D12 模块总览
|
||||
- [RHIDevice](../rhi-device.md) - RHI 设备基类
|
||||
- [RHIDevice](../rhi/device/device.md) - RHI 设备基类
|
||||
- [D3D12CommandQueue](d3d12-command-queue.md) - 命令队列
|
||||
- [D3D12Buffer](d3d12-buffer.md) - 缓冲区资源
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# D3D12SwapChain::GetCurrentBackBufferIndex
|
||||
|
||||
获取当前后缓冲区的索引。
|
||||
|
||||
```cpp
|
||||
uint32_t GetCurrentBackBufferIndex() const override;
|
||||
```
|
||||
|
||||
**返回:** `uint32_t` - 当前后缓冲区索引
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12SwapChain 总览](d3d12-swap-chain.md)
|
||||
13
docs/api/d3d12/d3d12-swap-chain-get-current-back-buffer.md
Normal file
13
docs/api/d3d12/d3d12-swap-chain-get-current-back-buffer.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12SwapChain::GetCurrentBackBuffer
|
||||
|
||||
获取当前后缓冲区的纹理对象。
|
||||
|
||||
```cpp
|
||||
RHITexture* GetCurrentBackBuffer() override;
|
||||
```
|
||||
|
||||
**返回:** `RHITexture*` - 当前后缓冲区的纹理指针
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12SwapChain 总览](d3d12-swap-chain.md)
|
||||
36
docs/api/d3d12/d3d12-swap-chain-initialize.md
Normal file
36
docs/api/d3d12/d3d12-swap-chain-initialize.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# D3D12SwapChain::Initialize
|
||||
|
||||
初始化 D3D12SwapChain 交换链。
|
||||
|
||||
## 重载 1: 从头创建
|
||||
|
||||
```cpp
|
||||
bool Initialize(IDXGIFactory4* factory, ID3D12CommandQueue* commandQueue, HWND windowHandle, uint32_t width, uint32_t height, uint32_t bufferCount = 2);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `factory` - DXGI 工厂指针
|
||||
- `commandQueue` - 命令队列指针
|
||||
- `windowHandle` - 窗口句柄
|
||||
- `width` - 宽度
|
||||
- `height` - 高度
|
||||
- `bufferCount` - 缓冲数量,默认为 2
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true
|
||||
|
||||
## 重载 2: 从现有交换链创建
|
||||
|
||||
```cpp
|
||||
bool Initialize(IDXGISwapChain* swapChain, uint32_t width, uint32_t height);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `swapChain` - 现有 DXGI 交换链指针
|
||||
- `width` - 宽度
|
||||
- `height` - 高度
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12SwapChain 总览](d3d12-swap-chain.md)
|
||||
15
docs/api/d3d12/d3d12-swap-chain-present.md
Normal file
15
docs/api/d3d12/d3d12-swap-chain-present.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12SwapChain::Present
|
||||
|
||||
呈现当前帧。
|
||||
|
||||
```cpp
|
||||
void Present(uint32_t syncInterval = 1, uint32_t flags = 0) override;
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `syncInterval` - 垂直同步间隔,默认为 1
|
||||
- `flags` - 呈现标志,默认为 0
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12SwapChain 总览](d3d12-swap-chain.md)
|
||||
15
docs/api/d3d12/d3d12-swap-chain-resize.md
Normal file
15
docs/api/d3d12/d3d12-swap-chain-resize.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# D3D12SwapChain::Resize
|
||||
|
||||
调整交换链大小。
|
||||
|
||||
```cpp
|
||||
void Resize(uint32_t width, uint32_t height) override;
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `width` - 新宽度
|
||||
- `height` - 新高度
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12SwapChain 总览](d3d12-swap-chain.md)
|
||||
11
docs/api/d3d12/d3d12-swap-chain-shutdown.md
Normal file
11
docs/api/d3d12/d3d12-swap-chain-shutdown.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# D3D12SwapChain::Shutdown
|
||||
|
||||
关闭交换链并释放相关资源。
|
||||
|
||||
```cpp
|
||||
void Shutdown() override;
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12SwapChain 总览](d3d12-swap-chain.md)
|
||||
@@ -24,12 +24,8 @@ D3D12SwapChain 是 DirectX 12 交换链的封装类,继承自 RHISwapChain 接
|
||||
| [GetCurrentBackBuffer](d3d12-swap-chain-get-current-back-buffer.md) | 获取当前后缓冲 |
|
||||
| [Present](d3d12-swap-chain-present.md) | 呈现 |
|
||||
| [Resize](d3d12-swap-chain-resize.md) | 调整大小 |
|
||||
| [SetFullscreen](d3d12-swap-chain-set-fullscreen.md) | 设置全屏 |
|
||||
| [IsFullscreen](d3d12-swap-chain-is-fullscreen.md) | 检查全屏状态 |
|
||||
| [ShouldClose](d3d12-swap-chain-should-close.md) | 检查是否应关闭 |
|
||||
| [PollEvents](d3d12-swap-chain-poll-events.md) | 轮询窗口事件 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 模块概览](d3d12.md) - D3D12 模块总览
|
||||
- [RHISwapChain](../rhi-swap-chain.md) - RHI 交换链基类
|
||||
- [RHISwapChain](../rhi/swap-chain/swap-chain.md) - RHI 交换链基类
|
||||
|
||||
13
docs/api/d3d12/d3d12-texture-get-depth.md
Normal file
13
docs/api/d3d12/d3d12-texture-get-depth.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Texture::GetDepth
|
||||
|
||||
获取纹理深度。
|
||||
|
||||
```cpp
|
||||
uint32_t GetDepth() const override;
|
||||
```
|
||||
|
||||
**返回:** `uint32_t` - 纹理深度(3D纹理)或数组大小
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
13
docs/api/d3d12/d3d12-texture-get-desc.md
Normal file
13
docs/api/d3d12/d3d12-texture-get-desc.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Texture::GetDesc
|
||||
|
||||
获取 D3D12 资源描述结构。
|
||||
|
||||
```cpp
|
||||
D3D12_RESOURCE_DESC GetDesc() const;
|
||||
```
|
||||
|
||||
**返回:** `D3D12_RESOURCE_DESC` - D3D12 资源描述结构
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
13
docs/api/d3d12/d3d12-texture-get-height.md
Normal file
13
docs/api/d3d12/d3d12-texture-get-height.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Texture::GetHeight
|
||||
|
||||
获取纹理高度。
|
||||
|
||||
```cpp
|
||||
uint32_t GetHeight() const override;
|
||||
```
|
||||
|
||||
**返回:** `uint32_t` - 纹理高度(像素)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
13
docs/api/d3d12/d3d12-texture-get-mip-levels.md
Normal file
13
docs/api/d3d12/d3d12-texture-get-mip-levels.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Texture::GetMipLevels
|
||||
|
||||
获取 Mip 级别数。
|
||||
|
||||
```cpp
|
||||
uint32_t GetMipLevels() const override;
|
||||
```
|
||||
|
||||
**返回:** `uint32_t` - Mip 级别数量
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
13
docs/api/d3d12/d3d12-texture-get-resource.md
Normal file
13
docs/api/d3d12/d3d12-texture-get-resource.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Texture::GetResource
|
||||
|
||||
获取底层 D3D12 资源指针。
|
||||
|
||||
```cpp
|
||||
ID3D12Resource* GetResource() const;
|
||||
```
|
||||
|
||||
**返回:** `ID3D12Resource*` - 底层 D3D12 资源指针
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
13
docs/api/d3d12/d3d12-texture-get-state.md
Normal file
13
docs/api/d3d12/d3d12-texture-get-state.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Texture::GetState
|
||||
|
||||
获取纹理当前资源状态。
|
||||
|
||||
```cpp
|
||||
ResourceStates GetState() const override;
|
||||
```
|
||||
|
||||
**返回:** `ResourceStates` - 当前资源状态
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
13
docs/api/d3d12/d3d12-texture-get-width.md
Normal file
13
docs/api/d3d12/d3d12-texture-get-width.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# D3D12Texture::GetWidth
|
||||
|
||||
获取纹理宽度。
|
||||
|
||||
```cpp
|
||||
uint32_t GetWidth() const override;
|
||||
```
|
||||
|
||||
**返回:** `uint32_t` - 纹理宽度(像素)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
19
docs/api/d3d12/d3d12-texture-initialize-depth-stencil.md
Normal file
19
docs/api/d3d12/d3d12-texture-initialize-depth-stencil.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Texture::InitializeDepthStencil
|
||||
|
||||
初始化深度模板纹理。
|
||||
|
||||
```cpp
|
||||
bool InitializeDepthStencil(ID3D12Device* device, uint32_t width, uint32_t height, DXGI_FORMAT format = DXGI_FORMAT_D24_UNORM_S8_UINT);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `device` - DirectX 12 设备指针
|
||||
- `width` - 纹理宽度
|
||||
- `height` - 纹理高度
|
||||
- `format` - 深度格式,默认为 DXGI_FORMAT_D24_UNORM_S8_UINT
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true,失败返回 false
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
23
docs/api/d3d12/d3d12-texture-initialize-from-data.md
Normal file
23
docs/api/d3d12/d3d12-texture-initialize-from-data.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# D3D12Texture::InitializeFromData
|
||||
|
||||
从数据初始化纹理。
|
||||
|
||||
```cpp
|
||||
bool InitializeFromData(ID3D12Device* device, ID3D12GraphicsCommandList* commandList, const void* pixelData, uint32_t width, uint32_t height, DXGI_FORMAT format, uint32_t rowPitch = 0, ComPtr<ID3D12Resource>* uploadBuffer = nullptr);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `device` - DirectX 12 设备指针
|
||||
- `commandList` - 用于上传命令的命令列表
|
||||
- `pixelData` - 像素数据指针
|
||||
- `width` - 纹理宽度
|
||||
- `height` - 纹理高度
|
||||
- `format` - 纹理格式
|
||||
- `rowPitch` - 行pitch(默认为0)
|
||||
- `uploadBuffer` - 可选的上传缓冲区输出指针
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true,失败返回 false
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
17
docs/api/d3d12/d3d12-texture-initialize-from-existing.md
Normal file
17
docs/api/d3d12/d3d12-texture-initialize-from-existing.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# D3D12Texture::InitializeFromExisting
|
||||
|
||||
从现有的 D3D12 资源初始化纹理。
|
||||
|
||||
```cpp
|
||||
bool InitializeFromExisting(ID3D12Resource* resource, bool ownsResource = false);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `resource` - 已存在的 D3D12 资源指针
|
||||
- `ownsResource` - 是否拥有资源所有权
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true,失败返回 false
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
18
docs/api/d3d12/d3d12-texture-initialize.md
Normal file
18
docs/api/d3d12/d3d12-texture-initialize.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# D3D12Texture::Initialize
|
||||
|
||||
初始化 D3D12Texture 纹理资源。
|
||||
|
||||
```cpp
|
||||
bool Initialize(ID3D12Device* device, const D3D12_RESOURCE_DESC& desc, D3D12_RESOURCE_STATES initialState = D3D12_RESOURCE_STATE_COMMON);
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `device` - DirectX 12 设备指针
|
||||
- `desc` - 纹理资源描述
|
||||
- `initialState` - 初始资源状态,默认为 Common 状态
|
||||
|
||||
**返回:** `bool` - 初始化成功返回 true,失败返回 false
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
14
docs/api/d3d12/d3d12-texture-set-state.md
Normal file
14
docs/api/d3d12/d3d12-texture-set-state.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# D3D12Texture::SetState
|
||||
|
||||
设置纹理资源状态。
|
||||
|
||||
```cpp
|
||||
void SetState(ResourceStates state) override;
|
||||
```
|
||||
|
||||
**参数:**
|
||||
- `state` - 目标资源状态
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
11
docs/api/d3d12/d3d12-texture-shutdown.md
Normal file
11
docs/api/d3d12/d3d12-texture-shutdown.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# D3D12Texture::Shutdown
|
||||
|
||||
关闭纹理并释放相关资源。
|
||||
|
||||
```cpp
|
||||
void Shutdown() override;
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Texture 总览](d3d12-texture.md)
|
||||
@@ -35,4 +35,4 @@ D3D12Texture 是 DirectX 12 纹理资源的封装类,继承自 RHITexture 接
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 模块概览](d3d12.md) - D3D12 模块总览
|
||||
- [RHITexture](../rhi-texture.md) - RHI 纹理基类
|
||||
- [RHITexture](../rhi/texture/texture.md) - RHI 纹理基类
|
||||
|
||||
@@ -27,14 +27,6 @@ D3D12 模块遵循 DirectX 12 的设计理念,提供低开销的渲染命令
|
||||
|------|------|------|
|
||||
| [D3D12CommandQueue](d3d12-command-queue.md) | `D3D12CommandQueue.h` | 命令队列封装,提交命令列表到 GPU |
|
||||
| [D3D12CommandList](d3d12-command-list.md) | `D3D12CommandList.h` | 命令列表封装,录制图形和计算命令 |
|
||||
| [D3D12CommandAllocator](d3d12-command-allocator.md) | `D3D12CommandAllocator.h` | 命令分配器,管理命令列表内存 |
|
||||
|
||||
### 同步与查询
|
||||
|
||||
| 组件 | 文件 | 描述 |
|
||||
|------|------|------|
|
||||
| [D3D12Fence](d3d12-fence.md) | `D3D12Fence.h` | GPU/CPU 同步围栏 |
|
||||
| [D3D12QueryHeap](d3d12-query-heap.md) | `D3D12QueryHeap.h` | 查询堆,用于性能计数器和遮挡查询 |
|
||||
|
||||
### 资源
|
||||
|
||||
@@ -44,32 +36,7 @@ D3D12 模块遵循 DirectX 12 的设计理念,提供低开销的渲染命令
|
||||
| [D3D12Texture](d3d12-texture.md) | `D3D12Texture.h` | 纹理资源(1D/2D/3D/立方体) |
|
||||
| [D3D12SwapChain](d3d12-swap-chain.md) | `D3D12SwapChain.h` | 交换链,管理帧缓冲 |
|
||||
|
||||
### 渲染状态
|
||||
|
||||
| 组件 | 文件 | 描述 |
|
||||
|------|------|------|
|
||||
| [D3D12Shader](d3d12-shader.md) | `D3D12Shader.h` | 着色器编译与管理 |
|
||||
| [D3D12PipelineState](d3d12-pipeline-state.md) | `D3D12PipelineState.h` | 图形管道状态对象 |
|
||||
| [D3D12RootSignature](d3d12-root-signature.md) | `D3D12RootSignature.h` | 根签名,定义着色器参数布局 |
|
||||
|
||||
### 描述符与视图
|
||||
|
||||
| 组件 | 文件 | 描述 |
|
||||
|------|------|------|
|
||||
| [D3D12DescriptorHeap](d3d12-descriptor-heap.md) | `D3D12DescriptorHeap.h` | 描述符堆,管理渲染目标、深度模板、SRV、UAV 等 |
|
||||
| [D3D12Sampler](d3d12-sampler.md) | `D3D12Sampler.h` | 采样器状态 |
|
||||
| [D3D12RenderTargetView](d3d12-render-target-view.md) | `D3D12RenderTargetView.h` | 渲染目标视图 |
|
||||
| [D3D12DepthStencilView](d3d12-depth-stencil-view.md) | `D3D12DepthStencilView.h` | 深度模板视图 |
|
||||
| [D3D12ShaderResourceView](d3d12-shader-resource-view.md) | `D3D12ShaderResourceView.h` | 着色器资源视图 |
|
||||
| [D3D12UnorderedAccessView](d3d12-unordered-access-view.md) | `D3D12UnorderedAccessView.md` | 无序访问视图 |
|
||||
| [D3D12ConstantBufferView](d3d12-constant-buffer-view.md) | `D3D12ConstantBufferView.md` | 常量缓冲区视图 |
|
||||
|
||||
### 工具
|
||||
|
||||
| 组件 | 文件 | 描述 |
|
||||
|------|------|------|
|
||||
| [D3D12Screenshot](d3d12-screenshot.md) | `D3D12Screenshot.h` | 截图工具 |
|
||||
| [D3D12Common](d3d12-common.md) | `D3D12Common.h` | 内联工具函数 |
|
||||
|
||||
## 类型映射
|
||||
|
||||
@@ -136,7 +103,4 @@ device.Shutdown();
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHI 模块总览](../module.md) - RHI 抽象层概述
|
||||
- [RHIEnums](../rhi-enums.md) - RHI 枚举定义
|
||||
- [RHITypes](../rhi-types.md) - RHI 类型定义
|
||||
- [D3D12 后端测试设计](../../plan/D3D12后端测试设计.md) - D3D12 测试设计文档
|
||||
- [RHI 模块总览](../rhi/rhi.md) - RHI 抽象层概述
|
||||
|
||||
Reference in New Issue
Block a user