use GLubyte for stencil ref/mask/clear
authorBrian <brian.paul@tungstengraphics.com>
Fri, 25 May 2007 04:16:26 +0000 (22:16 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 25 May 2007 04:16:26 +0000 (22:16 -0600)
src/mesa/softpipe/sp_state.h
src/mesa/softpipe/state_tracker/st_atom_stencil.c

index 73ed7a6..f7d904b 100644 (file)
@@ -131,10 +131,10 @@ struct softpipe_stencil_state {
    GLuint back_fail_op:3;
    GLuint back_zpass_op:3;
    GLuint back_zfail_op:3;
-   GLint ref_value[2];      /**< [0] = front, [1] = back */
-   GLuint value_mask[2];
-   GLuint write_mask[2];
-   GLuint clear_value;
+   GLubyte ref_value[2];      /**< [0] = front, [1] = back */
+   GLubyte value_mask[2];
+   GLubyte write_mask[2];
+   GLubyte clear_value;
 };
 
 
index ac8de03..32610c3 100644 (file)
@@ -102,20 +102,20 @@ update_stencil( struct st_context *st )
       stencil.front_fail_op = gl_stencil_op_to_sp(st->ctx->Stencil.FailFunc[0]);
       stencil.front_zfail_op = gl_stencil_op_to_sp(st->ctx->Stencil.ZFailFunc[0]);
       stencil.front_zpass_op = gl_stencil_op_to_sp(st->ctx->Stencil.ZPassFunc[0]);
-      stencil.ref_value[0] = st->ctx->Stencil.Ref[0];
-      stencil.value_mask[0] = st->ctx->Stencil.ValueMask[0];
-      stencil.write_mask[0] = st->ctx->Stencil.WriteMask[0];
+      stencil.ref_value[0] = st->ctx->Stencil.Ref[0] & 0xff;
+      stencil.value_mask[0] = st->ctx->Stencil.ValueMask[0] & 0xff;
+      stencil.write_mask[0] = st->ctx->Stencil.WriteMask[0] & 0xff;
       if (st->ctx->Stencil.TestTwoSide) {
          stencil.back_enabled = 1;
          stencil.back_func = gl_stencil_func_to_sp(st->ctx->Stencil.Function[1]);
          stencil.back_fail_op = gl_stencil_op_to_sp(st->ctx->Stencil.FailFunc[1]);
          stencil.back_zfail_op = gl_stencil_op_to_sp(st->ctx->Stencil.ZFailFunc[1]);
          stencil.back_zpass_op = gl_stencil_op_to_sp(st->ctx->Stencil.ZPassFunc[1]);
-         stencil.ref_value[1] = st->ctx->Stencil.Ref[1];
-         stencil.value_mask[1] = st->ctx->Stencil.ValueMask[1];
-         stencil.write_mask[1] = st->ctx->Stencil.WriteMask[1];
+         stencil.ref_value[1] = st->ctx->Stencil.Ref[1] & 0xff;
+         stencil.value_mask[1] = st->ctx->Stencil.ValueMask[1] & 0xff;
+         stencil.write_mask[1] = st->ctx->Stencil.WriteMask[1] & 0xff;
       }
-      stencil.clear_value = st->ctx->Stencil.Clear;
+      stencil.clear_value = st->ctx->Stencil.Clear & 0xff;
    }
 
    if (memcmp(&stencil, &st->state.stencil, sizeof(stencil)) != 0) {