From: Brian Paul <brian.paul@tu...> - 2008-02-20 15:52:27
Eric Anholt wrote:
> We had an issue with the driver crashing in handling bad vertex program
> strings, so I wrote a little glean test for it and the associated GL
> errors that are supposed to be emitted when rendering with an invalid
> program active. Mesa doesn't report errors for the rendering cases and
> thus fails the tests.
I've fixed things so GL_INVALID_OPERATION is raised for bad program strings.
But I think your glBegin-time test for a valid program is incorrect. If
glProgramString() is called with bad data, an error should be recorded,
but the previously defined program should remain in effect. That's
consistant with other GL calls (if the call generates an error, don't
change any GL state). This is also what I see with NVIDIA's driver.
So, the glBegin-time test for GL_INVALID_OPERATION should be removed.
Another way to test for that would be to bind a non-existant vertex
program before drawing.
Finally, I think this code:
> + while (err != 0)
> + glGetError();
while (err != 0)
err = glGetError();