From: Brian Paul Date: Mon, 31 Aug 2009 17:17:59 +0000 (-0600) Subject: mesa: added const qualifiers, move local var X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f36473a8ecc9c3358ae99651f511725344f22cc;p=mesa.git mesa: added const qualifiers, move local var --- diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 050a3a99fed..454d97506ed 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -936,7 +936,7 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, } } -static GLboolean args_match( struct state_key *key, GLuint unit ) +static GLboolean args_match( const struct state_key *key, GLuint unit ) { GLuint i, nr = key->unit[unit].NumArgsRGB; @@ -1096,11 +1096,10 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, static struct ureg emit_texenv(struct texenv_fragment_program *p, GLuint unit) { - struct state_key *key = p->state; + const struct state_key *key = p->state; GLboolean saturate; GLuint rgb_shift, alpha_shift; - struct ureg out, shift; - struct ureg dest; + struct ureg out, dest; if (!key->unit[unit].enabled) { return get_source(p, SRC_PREVIOUS, 0); @@ -1152,7 +1151,6 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) } else if (key->unit[unit].ModeRGB == MODE_DOT3_RGBA_EXT || key->unit[unit].ModeRGB == MODE_DOT3_RGBA) { - out = emit_combine( p, dest, WRITEMASK_XYZW, saturate, unit, key->unit[unit].NumArgsRGB, @@ -1178,7 +1176,10 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) /* Deal with the final shift: */ if (alpha_shift || rgb_shift) { + struct ureg shift; + saturate = GL_TRUE; /* always saturate at this point */ + if (rgb_shift == alpha_shift) { shift = register_scalar_const(p, (GLfloat)(1<state; + const struct state_key *key = p->state; GLuint i; for (i = 0; i < key->unit[unit].NumArgsRGB; i++) { @@ -1298,7 +1299,7 @@ load_texunit_sources( struct texenv_fragment_program *p, int unit ) static GLboolean load_texunit_bumpmap( struct texenv_fragment_program *p, int unit ) { - struct state_key *key = p->state; + const struct state_key *key = p->state; GLuint bumpedUnitNr = key->unit[unit].OptRGB[1].Source - SRC_TEXTURE0; struct ureg texcDst, bumpMapRes; struct ureg constdudvcolor = register_const4f(p, 0.0, 0.0, 0.0, 1.0);