29 lines
582 B
Markdown
29 lines
582 B
Markdown
# Shader::SetCompiledBinary
|
|
|
|
```cpp
|
|
void SetCompiledBinary(const Containers::Array<Core::uint8>& binary)
|
|
```
|
|
|
|
设置编译后的着色器二进制数据。
|
|
|
|
**参数:**
|
|
- `binary` - 编译后的二进制数据数组
|
|
|
|
**返回:** 无
|
|
|
|
**线程安全:** ❌ 非线程安全
|
|
|
|
**复杂度:** O(n) - 复制二进制数据
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
// 假设 compiler 是外部着色器编译器
|
|
Containers::Array<Core::uint8> compiledSpirv = compiler.Compile(sourceCode);
|
|
shader.SetCompiledBinary(compiledSpirv);
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [Shader 总览](shader.md) - 返回类总览
|