diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 3ce0a4e6f21..ddee1b2d896 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1858,7 +1858,7 @@ void anv_GetPhysicalDeviceProperties( .maxDescriptorSetSampledImages = 6 * max_textures, /* number of stages * maxPerStageDescriptorSampledImages */ .maxDescriptorSetStorageImages = 6 * max_images, /* number of stages * maxPerStageDescriptorStorageImages */ .maxDescriptorSetInputAttachments = MAX_DESCRIPTOR_SET_INPUT_ATTACHMENTS, - .maxVertexInputAttributes = MAX_VBS, + .maxVertexInputAttributes = MAX_VES, .maxVertexInputBindings = MAX_VBS, /* Broadwell PRMs: Volume 2d: Command Reference: Structures: * diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 75f3ec2de03..12694dc3b70 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -187,7 +187,16 @@ struct intel_perf_query_result; */ #define ANV_HZ_FC_VAL 1.0f -#define MAX_VBS 28 +/* 3DSTATE_VERTEX_BUFFER supports 33 VBs, we use 2 for base & drawid SGVs */ +#define MAX_VBS (33 - 2) + +/* 3DSTATE_VERTEX_ELEMENTS supports up to 34 VEs, but our backend compiler + * only supports the push model of VS inputs, and we only have 128 GRFs, + * minus the g0 and g1 payload, which gives us a maximum of 31 VEs. Plus, + * we use two of them for SGVs. + */ +#define MAX_VES (31 - 2) + #define MAX_XFB_BUFFERS 4 #define MAX_XFB_STREAMS 4 #define MAX_SETS 32