[Libva] [PATCH] i965 render: Explicitly disable instancing for vertex elements on Gen8+

Zhao, Yakui yakui.zhao at intel.com
Sun Jan 11 16:21:24 PST 2015


On Fri, 2015-01-09 at 14:39 -0700, Sean V Kelley wrote:
> From: Kenneth Graunke <kenneth at whitecape.org>
> 
> We really should guarantee that vertex elements non-instanced,
> especially since we don't use our own hardware context - other
> programs can change this on us.

LGTM. This patch will be pushed.

Thanks
    Yakui
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> Acked-by: Sean V Kelley <seanvk at posteo.de>
> ---
>  src/gen8_render.c  | 8 ++++++++
>  src/i965_defines.h | 3 +++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/src/gen8_render.c b/src/gen8_render.c
> index b7494a1..8a8012d 100644
> --- a/src/gen8_render.c
> +++ b/src/gen8_render.c
> @@ -950,6 +950,7 @@ gen8_emit_vertex_element_state(VADriverContextP ctx)
>  {
>      struct i965_driver_data *i965 = i965_driver_data(ctx);
>      struct intel_batchbuffer *batch = i965->batch;
> +    int i;
>  
>      /*
>       * The VUE layout
> @@ -993,6 +994,13 @@ gen8_emit_vertex_element_state(VADriverContextP ctx)
>                (I965_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_1_SHIFT) |
>                (I965_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_2_SHIFT) |
>                (I965_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_3_SHIFT));
> +
> +    /* Disable instancing for all vertex elements. */
> +    for (i = 0; i < 3; i++) {
> +	OUT_BATCH(batch, GEN8_3DSTATE_VF_INSTANCING | (3 - 2));
> +	OUT_BATCH(batch, i);
> +	OUT_BATCH(batch, 0);
> +    }
>  }
>  
>  static void
> diff --git a/src/i965_defines.h b/src/i965_defines.h
> index 33829db..727abd6 100755
> --- a/src/i965_defines.h
> +++ b/src/i965_defines.h
> @@ -327,6 +327,9 @@
>  #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_HS          CMD(3, 0, 0x2c)
>  #define GEN7_3DSTATE_SAMPLER_STATE_POINTERS_DS          CMD(3, 0, 0x2d)
>  
> +#define GEN7_3DSTATE_VF                                 CMD(3, 0, 0x0c)
> +#define GEN8_3DSTATE_VF_INSTANCING                      CMD(3, 0, 0x49)
> +
>  #define MFX(pipeline, op, sub_opa, sub_opb)     \
>      (3 << 29 |                                  \
>       (pipeline) << 27 |                         \




More information about the Libva mailing list