39 lines
840 B
Markdown
39 lines
840 B
Markdown
# D3D12Common::CreateRenderTargetClearValue
|
|
|
|
```cpp
|
|
inline D3D12_CLEAR_VALUE CreateRenderTargetClearValue(
|
|
DXGI_FORMAT format,
|
|
float r = 0.0f,
|
|
float g = 0.0f,
|
|
float b = 0.0f,
|
|
float a = 1.0f
|
|
)
|
|
```
|
|
|
|
创建渲染目标的清除值(清除颜色)。
|
|
|
|
**参数:**
|
|
- `format` - 渲染目标格式
|
|
- `r` - 红色分量,默认为 0.0f
|
|
- `g` - 绿色分量,默认为 0.0f
|
|
- `b` - 蓝色分量,默认为 0.0f
|
|
- `a` - Alpha 分量,默认为 1.0f
|
|
|
|
**返回:** 配置好的 `D3D12_CLEAR_VALUE` 结构
|
|
|
|
**线程安全:** ✅(纯函数)
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
D3D12_CLEAR_VALUE clearValue = CreateRenderTargetClearValue(
|
|
DXGI_FORMAT_R8G8B8A8_UNORM,
|
|
0.0f, 0.0f, 0.0f, 1.0f
|
|
);
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [D3D12Common 总览](common.md)
|
|
- [CreateDepthStencilClearValue](create-depth-stencil-clear-value.md)
|