From: Brian Date: Fri, 25 May 2007 04:16:26 +0000 (-0600) Subject: use GLubyte for stencil ref/mask/clear X-Git-Tag: 062012170305~17580^2~390^2~4817 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbe4dbef8e8e9ff29d64ca588e81c2bb079d99f1;p=profile%2Fivi%2Fmesa.git use GLubyte for stencil ref/mask/clear --- diff --git a/src/mesa/softpipe/sp_state.h b/src/mesa/softpipe/sp_state.h index 73ed7a6..f7d904b 100644 --- a/src/mesa/softpipe/sp_state.h +++ b/src/mesa/softpipe/sp_state.h @@ -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; }; diff --git a/src/mesa/softpipe/state_tracker/st_atom_stencil.c b/src/mesa/softpipe/state_tracker/st_atom_stencil.c index ac8de03..32610c3 100644 --- a/src/mesa/softpipe/state_tracker/st_atom_stencil.c +++ b/src/mesa/softpipe/state_tracker/st_atom_stencil.c @@ -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) {