Bug 11909 - GL_PACK_SWAP_BYTES dosen't work, when reading back from stencil buffer in GL_INT format
Summary: GL_PACK_SWAP_BYTES dosen't work, when reading back from stencil buffer in GL...
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-08 23:32 UTC by Shuang He
Modified: 2009-08-24 12:27 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
test case (2.04 KB, application/octet-stream)
2007-08-08 23:35 UTC, Shuang He
Details

Description Shuang He 2007-08-08 23:32:56 UTC
use glPixelStorei to set GL_PACK_SWAP_BYTES to GL_FALSE
draw a group of values into stencil buffer, 
then, use glPixelStorei to set GL_PACK_SWAP_BYTES to GL_TRUE
read back values from buffer, the byte order is not as expected.

The following patch should fix this:

--- src/mesa/main/image.c       2007-08-05 20:06:34.000000000 +0800
+++ src/mesa/main/b.c   2007-08-09 13:23:01.000000000 +0800
@@ -3794,7 +3794,7 @@
          GLint *dst = (GLint *) dest;
          GLuint i;
          for (i=0;i<n;i++) {
-            *dst++ = (GLint) source[i];
+            dst[i] = (GLint) source[i];
          }
          if (dstPacking->SwapBytes) {
             _mesa_swap4( (GLuint *) dst, n );
Comment 1 Shuang He 2007-08-08 23:35:14 UTC
Created attachment 11054 [details]
test case
Comment 2 Brian Paul 2007-08-09 00:49:22 UTC
fixed in git.
Comment 3 Shuang He 2007-08-13 21:57:58 UTC
verified on 945gm and g965
Comment 4 Adam Jackson 2009-08-24 12:27:40 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.