swrast: Use GL_STENCIL_INDEX for address calculations
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 29 Aug 2011 21:06:00 +0000 (14:06 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 6 Sep 2011 19:09:28 +0000 (12:09 -0700)
GL_COLOR_INDEX produced the same result (because GL_BITMAP is always
used for stencil glDrawPixels), but it was confusing to read.  I spent
about 15 minutes wondering, "WTF?"

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/swrast/s_drawpix.c

index 11c63457f52f9cd5c3618a9c2c8d35a25940454b..63bfa79b5133a2976321f03e266dae9c89952e29 100644 (file)
@@ -335,7 +335,7 @@ draw_stencil_pixels( struct gl_context *ctx, GLint x, GLint y,
                          ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT;
          const GLvoid *source = _mesa_image_address2d(unpack, pixels,
                                                       width, height,
-                                                      GL_COLOR_INDEX, type,
+                                                      GL_STENCIL_INDEX, type,
                                                       row, skipPixels);
          _mesa_unpack_stencil_span(ctx, spanWidth, destType, values,
                                    type, source, unpack,