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

Iago Toral Quiroga itoral at igalia.com
Fri Jul 21 08:26:30 UTC 2017


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):

>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
-- 
2.11.0



More information about the mesa-dev mailing list