Commit 112002ed authored by Vinson Lee's avatar Vinson Lee

fbo-drawbuffers-maxtargets: Gracefully handle glUseProgram errors.

On Mac OS X the fragment shader doesn't compile which eventually results
in an assertion failure in the test. Check for glUseProgram error
earlier and gracefully report a failure instead.

The Apple GLSL compiler gives this compilation error.
Failed to compile FS: ERROR: 0:4: 'gl_FragData' : Indirect access to
fragment shader output is not handled
WARNING: 0:4: 'gl_FragData[0]' : Indirect reference to an array with a
single element, not likely the desired construct.
parent d12a25ef
......@@ -86,7 +86,7 @@ static void
generate_and_display_drawbuffers(int count)
GLuint tex[16], fb, fs, vs, prog;
GLenum attachments[16], status;
GLenum attachments[16], status, error;
char *fs_count_source;
int i;
......@@ -121,6 +121,12 @@ generate_and_display_drawbuffers(int count)
prog = piglit_link_simple_program(vs, fs);
error = glGetError();
if (error) {
fprintf(stderr, "glUseProgram error: 0x%x\n", error);
/* Now render to all the color buffers. */
piglit_draw_rect(-1, -1, 2, 2);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment