Bug 12141 - glDrawElements bug for large array via indirect glx, plus patch
Summary: glDrawElements bug for large array via indirect glx, plus patch
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2007-08-24 07:14 UTC by Colin McDonald
Modified: 2009-08-24 12:27 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Updated version of CVS HEAD (50.15 KB, patch)
2007-08-24 07:31 UTC, Colin McDonald
Details | Splinter Review

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.