diff options
author | Kenneth Graunke <[email protected]> | 2013-12-09 15:58:35 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-12-20 12:25:33 -0800 |
commit | 23fc845f81f55332aef509b5eb0610bb6a0df4bc (patch) | |
tree | 7835511d52467fc72f8e764dd593844339458095 /src | |
parent | da872ddcc610b50e30afe9cdd42f3ff5dc513e70 (diff) |
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 <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_sf_state.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_sf_state.c | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 47d76e93e11..a205f64805c 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -143,6 +143,9 @@ calculate_attr_overrides(const struct brw_context *brw, const int urb_entry_read_offset = BRW_SF_URB_ENTRY_READ_OFFSET; uint32_t max_source_attr = 0; + *point_sprite_enables = 0; + *flat_enables = 0; + /* _NEW_LIGHT */ bool shade_model_flat = brw->ctx.Light.ShadeModel == GL_FLAT; @@ -242,8 +245,6 @@ upload_sf_state(struct brw_context *brw) dw3 = 0; dw4 = 0; - dw16 = 0; - dw17 = 0; /* _NEW_POLYGON */ if ((ctx->Polygon.FrontFace == GL_CCW) ^ render_to_fbo) diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c index 62362c2928a..5181d9810b1 100644 --- a/src/mesa/drivers/dri/i965/gen7_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c @@ -58,10 +58,6 @@ upload_sbe_state(struct brw_context *brw) } dw1 |= point_sprite_origin; - - dw10 = 0; - dw11 = 0; - /* BRW_NEW_VUE_MAP_GEOM_OUT | _NEW_POINT | _NEW_LIGHT | _NEW_PROGRAM | * CACHE_NEW_WM_PROG */ |