[Mesa-dev] [PATCH 2/3] anv: only expose up to 28 vertex attributes

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Jul 24 23:46:54 UTC 2017


On 21/07/17 09:26, Iago Toral Quiroga wrote:
> We were exposing 31 because the hardware allows for 33 and we need
> to reserve one vertex buffer to upload VertexIndex/InstanceIndex and
> another to upload DrawID when needed, however, there is another
> restriction in the hardware regarding the size of the VUE entries
> that limits this down to 30 (28 after VertexIndex and DrawID):

Something's weird here in the description from the PRMs (sorry, not your 
fault).
EU limit of 128 GRFs should allow 32 vertex elements of 4 GRFs.
Looking at the PRMs, it seems the limits arises from the maximum value 
allowed in "Vertex URB Entry Read Length" in SIMD8, which is 15.
And 15 * 8 = 120 gives us a limit to 30 vertex elements.

Is that a fair description?

>
>  From 3DSTATE_VS, Vertex URB entry read length:
>
>    "For SIMD8 dispatch, each vertex element requires 4 GRFs of
>     payload data, therefore the number of GRFs with vertex data will
>     be 8 times the value programmed in this field. The EU limit of 128
>     GRFs imposes a maximum limit of 30 elements per vertex pushed into
>     the payload, though the pactical limit may be lower."
>
> There is an assertion in place to check that we don't exceed this limit
> and that is triggered when we expose more than 28 attributes and we have
> shaders that use more than 30 attributes in total (including
> VertexIndex/InstanceIndex and DrawID).
> ---
>   src/intel/vulkan/anv_private.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
> index 4dce360c76..f83f49b671 100644
> --- a/src/intel/vulkan/anv_private.h
> +++ b/src/intel/vulkan/anv_private.h
> @@ -89,7 +89,7 @@ struct gen_l3_config;
>    */
>   #define ANV_HZ_FC_VAL 1.0f
>   
> -#define MAX_VBS         31
> +#define MAX_VBS         28
>   #define MAX_SETS         8
>   #define MAX_RTS          8
>   #define MAX_VIEWPORTS   16




More information about the mesa-dev mailing list