docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录 - 重命名 index.md 为 main.md - 修正所有模块文档中的错误: - math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式 - containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节 - core: 修复 types 链接错误 - debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI - memory: 修复头文件路径, malloc vs operator new, 新增方法文档 - resources: 修复 Shader/Texture 链接错误 - threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接 - 验证: fix_links.py 确认 0 个断裂引用
This commit is contained in:
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) - 返回类总览
|
||||
42
docs/api/rhi/d3d12/device/device.md
Normal file
42
docs/api/rhi/d3d12/device/device.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# 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) |
|
||||
|
||||
### D3D12 特有方法
|
||||
|
||||
| 方法 | 文档 |
|
||||
|------|------|
|
||||
| `GetDevice` | [详细文档](get-device.md) |
|
||||
| `GetFactory` | [详细文档](get-factory.md) |
|
||||
| `GetAdapterInfo` | [详细文档](get-adapter-info.md) |
|
||||
| `EnumerateAdapters` | [详细文档](enumerate-adapters.md) |
|
||||
| `GetDescriptorHandleIncrementSize` | [详细文档](get-descriptor-handle-increment-size.md) |
|
||||
| `CheckFeatureSupport` | [详细文档](check-feature-support.md) |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12 后端总览](../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) - 返回类总览
|
||||
19
docs/api/rhi/d3d12/device/get-factory.md
Normal file
19
docs/api/rhi/d3d12/device/get-factory.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# D3D12Device::GetFactory
|
||||
|
||||
```cpp
|
||||
IDXGIFactory4* GetFactory() const
|
||||
```
|
||||
|
||||
获取底层 DXGI 工厂指针。
|
||||
|
||||
**返回:** DXGI 工厂指针
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
IDXGIFactory4* factory = d3d12Device->GetFactory();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [D3D12Device 总览](device.md) - 返回类总览
|
||||
165
docs/api/rhi/d3d12/device/methods.md
Normal file
165
docs/api/rhi/d3d12/device/methods.md
Normal file
@@ -0,0 +1,165 @@
|
||||
# D3D12Device 方法
|
||||
|
||||
## 继承方法
|
||||
|
||||
### Initialize
|
||||
|
||||
```cpp
|
||||
bool Initialize(const RHIDeviceDesc& desc) override;
|
||||
```
|
||||
|
||||
初始化 D3D12 设备。
|
||||
|
||||
### Shutdown
|
||||
|
||||
```cpp
|
||||
void Shutdown() override;
|
||||
```
|
||||
|
||||
关闭设备。
|
||||
|
||||
### CreateBuffer
|
||||
|
||||
```cpp
|
||||
RHIBuffer* CreateBuffer(const BufferDesc& desc) override;
|
||||
```
|
||||
|
||||
创建 D3D12 缓冲区。
|
||||
|
||||
### CreateTexture
|
||||
|
||||
```cpp
|
||||
RHITexture* CreateTexture(const TextureDesc& desc) override;
|
||||
```
|
||||
|
||||
创建 D3D12 纹理。
|
||||
|
||||
### CreateSwapChain
|
||||
|
||||
```cpp
|
||||
RHISwapChain* CreateSwapChain(const SwapChainDesc& desc) override;
|
||||
```
|
||||
|
||||
创建 D3D12 交换链。
|
||||
|
||||
### CreateCommandList
|
||||
|
||||
```cpp
|
||||
RHICommandList* CreateCommandList(const CommandListDesc& desc) override;
|
||||
```
|
||||
|
||||
创建 D3D12 命令列表。
|
||||
|
||||
### CreateCommandQueue
|
||||
|
||||
```cpp
|
||||
RHICommandQueue* CreateCommandQueue(const CommandQueueDesc& desc) override;
|
||||
```
|
||||
|
||||
创建 D3D12 命令队列。
|
||||
|
||||
### CompileShader
|
||||
|
||||
```cpp
|
||||
RHIShader* CompileShader(const ShaderCompileDesc& desc) override;
|
||||
```
|
||||
|
||||
编译 D3D12 着色器。
|
||||
|
||||
### CreatePipelineState
|
||||
|
||||
```cpp
|
||||
RHIPipelineState* CreatePipelineState(const PipelineStateDesc& desc) override;
|
||||
```
|
||||
|
||||
创建 D3D12 管线状态对象。
|
||||
|
||||
### CreateFence
|
||||
|
||||
```cpp
|
||||
RHIFence* CreateFence(const FenceDesc& desc) override;
|
||||
```
|
||||
|
||||
创建 D3D12 栅栏。
|
||||
|
||||
### CreateSampler
|
||||
|
||||
```cpp
|
||||
RHISampler* CreateSampler(const SamplerDesc& desc) override;
|
||||
```
|
||||
|
||||
创建 D3D12 采样器。
|
||||
|
||||
### GetCapabilities
|
||||
|
||||
```cpp
|
||||
const RHICapabilities& GetCapabilities() const override;
|
||||
```
|
||||
|
||||
获取设备能力。
|
||||
|
||||
### GetDeviceInfo
|
||||
|
||||
```cpp
|
||||
const RHIDeviceInfo& GetDeviceInfo() const override;
|
||||
```
|
||||
|
||||
获取设备信息。
|
||||
|
||||
### GetNativeDevice
|
||||
|
||||
```cpp
|
||||
void* GetNativeDevice() override;
|
||||
```
|
||||
|
||||
获取原生 D3D12 设备指针。
|
||||
|
||||
## D3D12 特有方法
|
||||
|
||||
### GetDevice
|
||||
|
||||
```cpp
|
||||
ID3D12Device* GetDevice() const;
|
||||
```
|
||||
|
||||
获取 `ID3D12Device` 接口。
|
||||
|
||||
### GetFactory
|
||||
|
||||
```cpp
|
||||
IDXGIFactory4* GetFactory() const;
|
||||
```
|
||||
|
||||
获取 `IDXGIFactory4` 接口。
|
||||
|
||||
### GetAdapterInfo
|
||||
|
||||
```cpp
|
||||
const AdapterInfo& GetAdapterInfo() const;
|
||||
```
|
||||
|
||||
获取适配器信息。
|
||||
|
||||
### EnumerateAdapters
|
||||
|
||||
```cpp
|
||||
std::vector<AdapterInfo> EnumerateAdapters();
|
||||
```
|
||||
|
||||
枚举所有适配器。
|
||||
|
||||
### GetDescriptorHandleIncrementSize
|
||||
|
||||
```cpp
|
||||
UINT GetDescriptorHandleIncrementSize(DescriptorHeapType type) const;
|
||||
```
|
||||
|
||||
获取描述符句柄增量大小。
|
||||
|
||||
### CheckFeatureSupport
|
||||
|
||||
```cpp
|
||||
bool CheckFeatureSupport(D3D12_FEATURE feature, void* featureSupportData, uint32_t featureSupportDataSize);
|
||||
```
|
||||
|
||||
检查功能支持。
|
||||
Reference in New Issue
Block a user