From 1df1e0841de7da9587e8b1f5d43304627305d22d Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 25 Feb 2011 18:03:16 +0100 Subject: 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 --- src/gallium/drivers/i915/i915_state_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index 509d487b49..510fb1ccc6 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; -- cgit v1.2.3