summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-07-05 09:37:46 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-05 09:37:46 -0600
commitffa2659204121f703208782ff225a22e0c21b173 (patch)
treecd1f6cb70f971caeeff647d18f09d7e8ed990351 /src
parentc223c6b663cd5db39ba19c2be74b88cc3b8f53f3 (diff)
stencil pixel map didn't work in _mesa_unpack_stencil_span(), bug 11475
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/image.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index e2e7f806ab..e874719e64 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -3648,11 +3648,13 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
* Try simple cases first
*/
if (transferOps == 0 &&
+ !ctx->Pixel.MapStencilFlag &&
srcType == GL_UNSIGNED_BYTE &&
dstType == GL_UNSIGNED_BYTE) {
_mesa_memcpy(dest, source, n * sizeof(GLubyte));
}
else if (transferOps == 0 &&
+ !ctx->Pixel.MapStencilFlag &&
srcType == GL_UNSIGNED_INT &&
dstType == GL_UNSIGNED_INT &&
!srcPacking->SwapBytes) {
@@ -3668,19 +3670,17 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n,
extract_uint_indexes(n, indexes, GL_STENCIL_INDEX, srcType, source,
srcPacking);
- if (transferOps) {
- if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
- /* shift and offset indexes */
- shift_and_offset_ci(ctx, n, indexes);
- }
+ if (transferOps & IMAGE_SHIFT_OFFSET_BIT) {
+ /* shift and offset indexes */
+ shift_and_offset_ci(ctx, n, indexes);
+ }
- if (ctx->Pixel.MapStencilFlag) {
- /* Apply stencil lookup table */
- GLuint mask = ctx->PixelMaps.StoS.Size - 1;
- GLuint i;
- for (i=0;i<n;i++) {
- indexes[i] = ctx->PixelMaps.StoS.Map[ indexes[i] & mask ];
- }
+ if (ctx->Pixel.MapStencilFlag) {
+ /* Apply stencil lookup table */
+ const GLuint mask = ctx->PixelMaps.StoS.Size - 1;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ indexes[i] = ctx->PixelMaps.StoS.Map[ indexes[i] & mask ];
}
}