| Summary: |
GL_PACK_SWAP_BYTES dosen't work, when reading back from stencil buffer in GL_INT format |
| Product: |
Mesa
|
Reporter: |
Shuang He <shuang.he> |
| Component: |
Mesa core | Assignee: |
mesa-dev |
| Status: |
VERIFIED
FIXED
|
QA Contact: |
|
| Severity: |
normal
|
|
|
| Priority: |
medium
|
CC: |
dri-devel
|
| Version: |
git | |
|
| Hardware: |
All | |
|
| OS: |
All | |
|
| Whiteboard: |
|
|
i915 platform:
|
|
i915 features:
|
|
| Attachments: |
test case
|
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.
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 );