docs: update RHI API docs

This commit is contained in:
2026-03-20 02:35:45 +08:00
parent ea756c0177
commit 070b444f8f
501 changed files with 13493 additions and 2022 deletions

View File

@@ -2,6 +2,8 @@
**命名空间**: `XCEngine::RHI`
**类型**: 类 (继承自 `RHIShader`)
**描述**: DirectX 12 着色器的 D3D12 实现,继承自 `RHIShader`
## 公共方法
@@ -10,19 +12,35 @@
|------|------|
| [`CompileFromFile`](../../shader/compile-from-file.md) | 从文件编译着色器 |
| [`Compile`](../../shader/compile.md) | 从源码编译着色器 |
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭着色器 |
| [`Shutdown`](../../shader/shutdown.md) | 关闭着色器 |
| [`GetD3D12Bytecode`](get-d3d12-bytecode.md) | 获取 D3D12 字节码 |
| [`GetBytecode`](get-bytecode.md) | 获取字节码 |
| [`GetBytecodeSize`](get-bytecode-size.md) | 获取字节码大小 |
| [`GetType`](../../command-queue/get-type.md) | 获取着色器类型 |
| [`GetType`](../../shader/get-type.md) | 获取着色器类型 |
| [`GetInputLayout`](get-input-layout.md) | 获取输入布局 |
| [`GetNativeHandle`](../../buffer/get-native-handle.md) | 获取原生句柄 |
| [`GetNativeHandle`](../../shader/get-native-handle.md) | 获取原生句柄 |
| [`IsValid`](../../shader/is-valid.md) | 检查是否有效 |
| [`Bind`](../../shader/bind.md) | 绑定着色器 |
| [`Unbind`](../../shader/unbind.md) | 解绑着色器 |
| [`SetUniforms`](set-uniforms.md) | 设置 uniform 变量 |
| [`SetInt`](set-int.md) | 设置整型 uniform |
| [`SetFloat`](set-float.md) | 设置浮点型 uniform |
| [`SetVec3`](set-vec3.md) | 设置 Vec3 uniform |
| [`SetVec4`](set-vec4.md) | 设置 Vec4 uniform |
| [`SetMat4`](set-mat4.md) | 设置矩阵 uniform |
## 使用示例
```cpp
#include "XCEngine/RHI/D3D12/D3D12Shader.h"
auto shader = std::make_unique<D3D12Shader>();
if (shader->CompileFromFile(L"shaders/vertex.hlsl", "VSMain", "vs_6_0")) {
D3D12_SHADER_BYTECODE bytecode = shader->GetD3D12Bytecode();
// 使用字节码创建 PSO...
}
```
## 相关文档
- [D3D12 后端总览](../../opengl/overview.md)
- [D3D12 后端总览](../d3d12.md)
- [RHIShader](../../shader/shader.md) - 抽象着色器接口