i965: Zero out {point_sprite,flat}_enables in calculate_attr_overrides.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 9 Dec 2013 23:58:35 +0000 (15:58 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 20 Dec 2013 20:25:33 +0000 (12:25 -0800)
commit23fc845f81f55332aef509b5eb0610bb6a0df4bc
tree7835511d52467fc72f8e764dd593844339458095
parentda872ddcc610b50e30afe9cdd42f3ff5dc513e70
i965: Zero out {point_sprite,flat}_enables in calculate_attr_overrides.

calculate_attr_overrides is responsible for computing the point sprite
and flat-shading enable bitfields.  It does so by OR'ing in a bunch of
bits.  However, it relied on the caller to set the initial value to
zero.  This is pretty fragile - if the caller neglects to zero out those
variables, then the enable bitfields end up full of garbage, which shows
up as random things being flat-shaded.

This patch moves the zero-initialization into calculate_attr_overrides,
so that the computation is completely in one place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/gen6_sf_state.c
src/mesa/drivers/dri/i965/gen7_sf_state.c