Bug 12141

Summary: glDrawElements bug for large array via indirect glx, plus patch
Product: Mesa Reporter: Colin McDonald <cjmcdonald>
Component: GLXAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: cjmcdonald
Version: gitKeywords: patch
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Updated version of CVS HEAD

Description Colin McDonald 2007-08-24 07:14:22 UTC
When connected to a remote x-server using indirect glx, the glDrawElements client side vertex array routine has a bug for large arrays.

The bug is in routine emit_DrawElements_old in file:
Mesa/src/glx/x11/indirect_vertex_array.c

If the number of elements is too large to fit into a single X packet, it has to be spilt into multiple requests using the X RenderLarge command.  emit_DrawElements_old loops through the number of requests required, outputting the maximum number of elements for a single request each time.  But it does not increment the start element pointer, so that the first batch of elements is repeatedly sent in every request.  Elements towards the end of the input array are therefore never sent, and not rendered.

The emit_DrawElements_old routine implements the GL 1.1 DrawArrays protocol.  This is the current protocol ("old" is a misnomer) used by X servers which support OpenGL, including Xorg 7.x.  The bug can be demonstrated by sending a large glDrawElements array to a remote display server.
Comment 1 Colin McDonald 2007-08-24 07:31:34 UTC
Created attachment 11257 [details] [review]
Updated version of CVS HEAD

Patched file attached.
Comment 2 Brian Paul 2007-08-27 09:49:56 UTC
Thanks.  I've checked in your patch.  Though, your version inadvertantly undid a fix in the __glXGetArrayType() function (return array type, not the enable flag).  I've fixed that.
Comment 3 Adam Jackson 2009-08-24 12:27:52 UTC
Mass version move, cvs -> git

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.