KhronosGroup / KhronosGroup/OpenGL-API

What is the shader source string after calling glShaderSource with count=0

未关闭
#80 3 条评论 0 个 reaction 已指派 1 人 已被 @ianromanick 认领 在 GitHub 查看
主要语言
没有语言数据
星标
42
派生
8
PR 合并指标
30 天内没有已合并 PR

描述

What should be in `buf` when the code below is executed? The second call to `glShaderSource` should not generate an error, so it should presumably replace the existing shader source with... nothing?

```
const GLchar *source = "/* Testing 1... 2... 3... */";
const GLchar *junk = "/* Just some junk. */";

glShaderSource(shader, 1, &source, NULL);

glShaderSource(shader, 0, &junk, NULL);

GLchar buf[512];
GLsizei length;

glGetShaderSource(shader, sizeof(buf), &length, buf);
```

See also https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/521 and https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10477.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。