[Mesa-dev] [PATCH 1/2] i965: Trigger CS state reemission when new sampler state is uploaded.

Lofstedt, Marta marta.lofstedt at intel.com
Tue Jan 19 04:16:36 PST 2016


Thanks Curro,

Reviewed-by: Marta Lofstedt <marta.lofstedt at intel.com>


> -----Original Message-----
> From: Francisco Jerez [mailto:currojerez at riseup.net]
> Sent: Monday, January 18, 2016 9:37 PM
> To: mesa-dev at lists.freedesktop.org
> Cc: Lofstedt, Marta; Justen, Jordan L
> Subject: [PATCH 1/2] i965: Trigger CS state reemission when new sampler
> state is uploaded.
> 
> This reuses the NEW_SAMPLER_STATE_TABLE state bit (currently only used
> on pre-Gen7 hardware) to signal that the sampler state tables have changed
> in order to make sure that the GPGPU interface descriptor is updated.
> ---
>  src/mesa/drivers/dri/i965/brw_sampler_state.c | 2 +-
>  src/mesa/drivers/dri/i965/gen7_cs_state.c     | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c
> b/src/mesa/drivers/dri/i965/brw_sampler_state.c
> index d181468..24798a5 100644
> --- a/src/mesa/drivers/dri/i965/brw_sampler_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c
> @@ -582,7 +582,7 @@ brw_upload_sampler_state_table(struct
> brw_context *brw,
>        batch_offset_for_sampler_state += size_in_bytes;
>     }
> 
> -   if (brw->gen >= 7) {
> +   if (brw->gen >= 7 && stage_state->stage != MESA_SHADER_COMPUTE) {
>        /* Emit a 3DSTATE_SAMPLER_STATE_POINTERS_XS packet. */
>        gen7_emit_sampler_state_pointers_xs(brw, stage_state);
>     } else {
> diff --git a/src/mesa/drivers/dri/i965/gen7_cs_state.c
> b/src/mesa/drivers/dri/i965/gen7_cs_state.c
> index a025bb9..6d6988c 100644
> --- a/src/mesa/drivers/dri/i965/gen7_cs_state.c
> +++ b/src/mesa/drivers/dri/i965/gen7_cs_state.c
> @@ -196,6 +196,7 @@ const struct brw_tracked_state brw_cs_state = {
>        .brw = BRW_NEW_BATCH |
>               BRW_NEW_CS_PROG_DATA |
>               BRW_NEW_PUSH_CONSTANT_ALLOCATION |
> +             BRW_NEW_SAMPLER_STATE_TABLE |
>               BRW_NEW_SURFACES,
>     },
>     .emit = brw_upload_cs_state
> --
> 2.7.0



More information about the mesa-dev mailing list