Bug 5911

Summary: glDrawArrays server byte-swapping bug and patch.
Product: xorg Reporter: Colin McDonald <cjmcdonald>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: high Keywords: patch
Version: git   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:

Description Colin McDonald 2006-02-16 23:42:26 UTC
The OpenGL glDrawArrays function is not working when rendering from a
big-endian client application host to a little-endian display server.
No output is produced and/or the X server can crash.

Function __glXDispSwap_DrawArrays in xserver/xorg/GL/glx/render2swap.c
from the CVS head is not byte-swapping all of the values as needed.
There are two loops through the compHeader structure array, but the
extracted values are only swapped in the first loop.

diff -c of patch:

*** render2swap.c       Thu Feb 16 12:11:01 2006
--- render2swap.c.fix   Thu Feb 16 12:08:59 2006
***************
*** 311,316 ****
--- 311,320 ----
        GLint numVals = compHeader[i].numVals;
        GLenum component = compHeader[i].component;
  
+       __GLX_SWAP_INT(&datatype);
+       __GLX_SWAP_INT(&numVals);
+       __GLX_SWAP_INT(&component);
+ 
        swapArray(numVals, datatype, stride, numVertexes, pc);
  
          switch (component) {
Comment 1 Colin McDonald 2006-02-28 00:11:42 UTC
Fix applied to xserver/xorg/GL/glx/render2swap.c version 1.6 by Alexander 
Gottwald (bug #5978).

*** This bug has been marked as a duplicate of 5978 ***

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.