Files
XCSDD/docs/api/rhi/opengl/shader/compile-compute.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

31 lines
600 B
Markdown

# OpenGLShader::CompileCompute
```cpp
bool CompileCompute(const char* computeSource);
```
从源代码编译计算着色器。
**参数:**
- `computeSource` - 计算着色器源代码
**返回:** 成功返回 `true`,失败返回 `false`
**线程安全:**
**示例:**
```cpp
const char* cs = R"(
#version 430 core
layout(local_size_x = 16, local_size_y = 16) in;
void main() { /* compute logic */ }
)";
shader->CompileCompute(cs);
```
## 相关文档
- [OpenGLShader 总览](shader.md) - 返回类总览
- [Compile (VS+FS)](compile-vs-fs.md) - 图形着色器版本