Files
XCEngine/docs/api/rhi/d3d12/shader/set-int.md
2026-03-20 02:35:45 +08:00

37 lines
662 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# D3D12Shader::SetInt
## 函数签名
```cpp
void SetInt(const char* name, int value) override
```
## 中文描述
设置着色器中的整型 uniform 变量。当前实现为空stub
## 参数
| 参数 | 类型 | 描述 |
|------|------|------|
| `name` | `const char*` | 变量名称 |
| `value` | `int` | 变量值 |
## 返回值
## 示例
```cpp
shader->SetInt("useLighting", 1);
```
## 相关文档
- [D3D12Shader](shader.md) - 类总览
- [SetFloat](set-float.md) - 设置浮点型 uniform
- [SetVec3](set-vec3.md) - 设置 Vec3 uniform
- [SetVec4](set-vec4.md) - 设置 Vec4 uniform
- [SetMat4](set-mat4.md) - 设置矩阵 uniform