From: Daniel Vetter Date: Fri, 25 Feb 2011 17:03:16 +0000 (+0100) Subject: i915g: simplify math in constants emission X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1df1e0841de7da9587e8b1f5d43304627305d22d;p=mesa.git i915g: simplify math in constants emission The old code even falls apart for nr == 0 (which is caught earlier, but)! Signed-off-by: Daniel Vetter --- diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index 509d487b498..510fb1ccc63 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -362,7 +362,7 @@ i915_emit_hardware_state(struct i915_context *i915 ) uint i; OUT_BATCH( _3DSTATE_PIXEL_SHADER_CONSTANTS | (nr * 4) ); - OUT_BATCH( (1 << (nr - 1)) | ((1 << (nr - 1)) - 1) ); + OUT_BATCH((1 << nr) - 1); for (i = 0; i < nr; i++) { const uint *c;