[Mesa-dev] [PATCH 01/18] i965/cs: Add BRW_NEW_COMPUTE_PROGRAM state flag.

Kristian Høgsberg krh at bitplanet.net
Mon Apr 13 17:21:19 PDT 2015


On Sat, Mar 14, 2015 at 9:54 PM, Jordan Justen
<jordan.l.justen at intel.com> wrote:
> From: Paul Berry <stereotype441 at gmail.com>
>
> Also add code to brw_upload_state to set it when the compute program
> changes.
>
> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

> ---
>  src/mesa/drivers/dri/i965/brw_context.h      | 3 +++
>  src/mesa/drivers/dri/i965/brw_state_upload.c | 6 ++++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> index f15cd7c..2d4a00f 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -209,6 +209,7 @@ enum brw_state_id {
>     BRW_STATE_CLIP_VP,
>     BRW_STATE_SAMPLER_STATE_TABLE,
>     BRW_STATE_VS_ATTRIB_WORKAROUNDS,
> +   BRW_STATE_COMPUTE_PROGRAM,
>     BRW_NUM_STATE_BITS
>  };
>
> @@ -288,6 +289,7 @@ enum brw_state_id {
>  #define BRW_NEW_CLIP_VP                 (1ull << BRW_STATE_CLIP_VP)
>  #define BRW_NEW_SAMPLER_STATE_TABLE     (1ull << BRW_STATE_SAMPLER_STATE_TABLE)
>  #define BRW_NEW_VS_ATTRIB_WORKAROUNDS   (1ull << BRW_STATE_VS_ATTRIB_WORKAROUNDS)
> +#define BRW_NEW_COMPUTE_PROGRAM         (1ull << BRW_STATE_COMPUTE_PROGRAM)
>
>  struct brw_state_flags {
>     /** State update flags signalled by mesa internals */
> @@ -1182,6 +1184,7 @@ struct brw_context
>     const struct gl_vertex_program *vertex_program;
>     const struct gl_geometry_program *geometry_program;
>     const struct gl_fragment_program *fragment_program;
> +   const struct gl_compute_program *compute_program;
>
>     /**
>      * Number of samples in ctx->DrawBuffer, updated by BRW_NEW_NUM_SAMPLES so
> diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
> index 0b38c09..024e04a 100644
> --- a/src/mesa/drivers/dri/i965/brw_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
> @@ -570,6 +570,7 @@ static struct dirty_bit_map brw_bits[] = {
>     DEFINE_BIT(BRW_NEW_CLIP_VP),
>     DEFINE_BIT(BRW_NEW_SAMPLER_STATE_TABLE),
>     DEFINE_BIT(BRW_NEW_VS_ATTRIB_WORKAROUNDS),
> +   DEFINE_BIT(BRW_NEW_COMPUTE_PROGRAM),
>     {0, 0, 0}
>  };
>
> @@ -644,6 +645,11 @@ brw_upload_pipeline_state(struct brw_context *brw,
>        brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM;
>     }
>
> +   if (brw->compute_program != ctx->ComputeProgram._Current) {
> +      brw->compute_program = ctx->ComputeProgram._Current;
> +      brw->state.dirty.brw |= BRW_NEW_COMPUTE_PROGRAM;
> +   }
> +
>     if (brw->meta_in_progress != _mesa_meta_in_progress(ctx)) {
>        brw->meta_in_progress = _mesa_meta_in_progress(ctx);
>        brw->state.dirty.brw |= BRW_NEW_META_IN_PROGRESS;
> --
> 2.1.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