Files
XCEngine/docs/api/rhi/d3d12/shader/set-mat4.md

38 lines
799 B
Markdown
Raw Normal View History

2026-03-20 02:35:45 +08:00
# D3D12Shader::SetMat4
## 函数签名
```cpp
void SetMat4(const char* name, const float* value) override
```
## 中文描述
设置着色器中的 4x4 矩阵 uniform 变量。当前实现为空stub
## 参数
| 参数 | 类型 | 描述 |
|------|------|------|
| `name` | `const char*` | 变量名称 |
| `value` | `const float*` | 矩阵数据指针16 个 float 元素,按列主序存储) |
## 返回值
## 示例
```cpp
float matrixData[16] = { /* 4x4 矩阵数据 */ };
shader->SetMat4("transform", matrixData);
```
## 相关文档
- [D3D12Shader](shader.md) - 类总览
- [SetInt](set-int.md) - 设置整型 uniform
- [SetFloat](set-float.md) - 设置浮点型 uniform
- [SetVec3](set-vec3.md) - 设置 Vec3 uniform
- [SetVec4](set-vec4.md) - 设置 Vec4 uniform