Skip to content

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

@ianromanick

Description

@ianromanick

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions