i915g: simplify math in constants emission
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 25 Feb 2011 17:03:16 +0000 (18:03 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Sat, 26 Feb 2011 14:35:24 +0000 (15:35 +0100)
The old code even falls apart for nr == 0 (which is caught earlier, but)!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
src/gallium/drivers/i915/i915_state_emit.c

index 509d487b4988a8ff6a76c04da297209557fcfc08..510fb1ccc6365d1a1fd6acff2efbb41e772c20f0 100644 (file)
@@ -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;