[Mesa-dev] [PATCH 2/2] i965: Use {point_sprite, flat}_enable variable names instead of dw*.
Jordan Justen
jljusten at gmail.com
Mon Dec 16 14:19:00 PST 2013
On Mon, Dec 9, 2013 at 4:11 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Calling the local variables flat_enable and point_sprite_enable is
> clearer than dw16 and such. It also matches the names used in
> calculate_attr_overrides, which computes them.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Paul Berry <stereotype441 at gmail.com>
> ---
> src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +++++++-----
> src/mesa/drivers/dri/i965/gen7_sf_state.c | 12 +++++++-----
> 2 files changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
> index a205f64..fb9c294 100644
> --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
> +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
> @@ -227,7 +227,9 @@ upload_sf_state(struct brw_context *brw)
> struct gl_context *ctx = &brw->ctx;
> /* CACHE_NEW_WM_PROG */
> uint32_t num_outputs = brw->wm.prog_data->num_varying_inputs;
> - uint32_t dw1, dw2, dw3, dw4, dw16, dw17;
> + uint32_t dw1, dw2, dw3, dw4;
> + uint32_t point_sprite_enables;
> + uint32_t flat_enables;
> int i;
> /* _NEW_BUFFER */
> bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
> @@ -373,8 +375,8 @@ upload_sf_state(struct brw_context *brw)
> * CACHE_NEW_WM_PROG
> */
> uint32_t urb_entry_read_length;
> - calculate_attr_overrides(brw, attr_overrides, &dw16, &dw17,
> - &urb_entry_read_length);
> + calculate_attr_overrides(brw, attr_overrides, &point_sprite_enables,
> + &flat_enables, &urb_entry_read_length);
> dw1 |= (urb_entry_read_length << GEN6_SF_URB_ENTRY_READ_LENGTH_SHIFT |
> urb_entry_read_offset << GEN6_SF_URB_ENTRY_READ_OFFSET_SHIFT);
>
> @@ -390,8 +392,8 @@ upload_sf_state(struct brw_context *brw)
> for (i = 0; i < 8; i++) {
> OUT_BATCH(attr_overrides[i * 2] | attr_overrides[i * 2 + 1] << 16);
> }
> - OUT_BATCH(dw16); /* point sprite texcoord bitmask */
> - OUT_BATCH(dw17); /* constant interp bitmask */
> + OUT_BATCH(point_sprite_enables);
> + OUT_BATCH(flat_enables);
What about?
OUT_BATCH(point_sprite_enables); /* dw16 */
Sometimes the dw# is helpful when looking at the docs.
Series Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
> OUT_BATCH(0); /* wrapshortest enables 0-7 */
> OUT_BATCH(0); /* wrapshortest enables 8-15 */
> ADVANCE_BATCH();
> diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c
> index 5181d98..ad157ff 100644
> --- a/src/mesa/drivers/dri/i965/gen7_sf_state.c
> +++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c
> @@ -35,7 +35,9 @@ upload_sbe_state(struct brw_context *brw)
> struct gl_context *ctx = &brw->ctx;
> /* CACHE_NEW_WM_PROG */
> uint32_t num_outputs = brw->wm.prog_data->num_varying_inputs;
> - uint32_t dw1, dw10, dw11;
> + uint32_t dw1;
> + uint32_t point_sprite_enables;
> + uint32_t flat_enables;
> int i;
> const int urb_entry_read_offset = BRW_SF_URB_ENTRY_READ_OFFSET;
> uint16_t attr_overrides[16];
> @@ -62,8 +64,8 @@ upload_sbe_state(struct brw_context *brw)
> * CACHE_NEW_WM_PROG
> */
> uint32_t urb_entry_read_length;
> - calculate_attr_overrides(brw, attr_overrides, &dw10, &dw11,
> - &urb_entry_read_length);
> + calculate_attr_overrides(brw, attr_overrides, &point_sprite_enables,
> + &flat_enables, &urb_entry_read_length);
> dw1 |= urb_entry_read_length << GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT |
> urb_entry_read_offset << GEN7_SBE_URB_ENTRY_READ_OFFSET_SHIFT;
>
> @@ -76,8 +78,8 @@ upload_sbe_state(struct brw_context *brw)
> OUT_BATCH(attr_overrides[i * 2] | attr_overrides[i * 2 + 1] << 16);
> }
>
> - OUT_BATCH(dw10); /* point sprite texcoord bitmask */
> - OUT_BATCH(dw11); /* constant interp bitmask */
> + OUT_BATCH(point_sprite_enables);
> + OUT_BATCH(flat_enables);
> OUT_BATCH(0); /* wrapshortest enables 0-7 */
> OUT_BATCH(0); /* wrapshortest enables 8-15 */
> ADVANCE_BATCH();
> --
> 1.8.4.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list