[Mesa-dev] [PATCH 07/13] i965: Combine the two WM pull constant tracked state atoms.

Eric Anholt eric at anholt.net
Wed Nov 9 10:38:53 PST 2011


On Tue,  8 Nov 2011 14:32:06 -0800, Kenneth Graunke <kenneth at whitecape.org> wrote:
> These were only split for historical reasons: brw_wm_constants used to
> be the "prepare" step, while brw_wm_constant_surface was "emit".  Now
> that both happen at emit time, it makes sense to combine them.
> 
> Call the newly combined state atom "brw_wm_pull_constants" to indicate
> help distinguish it from the Gen6+ atoms that handle push constants.
> 
> Finally, remove the BRW_NEW_WM_CONSTBUF dirty bit entirely now that it's
> never flagged nor used.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_context.h          |    2 -
>  src/mesa/drivers/dri/i965/brw_state.h            |    3 +-
>  src/mesa/drivers/dri/i965/brw_state_upload.c     |   10 +---
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c |   58 ++++-----------------
>  4 files changed, 15 insertions(+), 58 deletions(-)

> @@ -357,10 +360,14 @@ brw_upload_wm_pull_constants(struct brw_context *brw)
>     }
>     drm_intel_gem_bo_unmap_gtt(brw->wm.const_bo);
>  
> -   brw->state.dirty.brw |= BRW_NEW_WM_CONSTBUF;
> +   intel->vtbl.create_constant_surface(brw, brw->wm.const_bo,
> +				       params->NumParameters,
> +				       &brw->wm.surf_offset[surf_index]);
> +
> +   brw->state.dirty.brw |= BRW_NEW_WM_SURFACES;
>  }
>  
> -const struct brw_tracked_state brw_wm_constants = {
> +const struct brw_tracked_state brw_wm_pull_constants = {
>     .dirty = {
>        .mesa = (_NEW_PROGRAM_CONSTANTS),
>        .brw = (BRW_NEW_FRAGMENT_PROGRAM),
> @@ -369,49 +376,6 @@ const struct brw_tracked_state brw_wm_constants = {
>     .emit = brw_upload_wm_pull_constants,
>  };

> -const struct brw_tracked_state brw_wm_constant_surface = {
> -   .dirty = {
> -      .mesa = 0,
> -      .brw = (BRW_NEW_WM_CONSTBUF |
> -	      BRW_NEW_BATCH),
> -      .cache = 0
> -   },
> -   .emit = upload_wm_constant_surface,
> -};

Looks like BRW_NEW_BATCH got lost in the refactor like in the VS refactor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111109/007ea97a/attachment.pgp>


More information about the mesa-dev mailing list