v3d,v3dv: stop hard-coding max attrib divisor

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28964>
This commit is contained in:
Iago Toral Quiroga 2024-04-29 09:17:22 +02:00 committed by Marge Bot
parent e8f96dd0b0
commit 027c01bd8f
4 changed files with 6 additions and 4 deletions

View File

@ -69,4 +69,6 @@
#define V3D_MAX_ARRAY_LAYERS 2048
#define V3D_MAX_VERTEX_ATTRIB_DIVISOR 0xffff
#endif /* V3D_LIMITS_H */

View File

@ -1459,13 +1459,13 @@ v3dv_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *props =
(VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *)ext;
props->maxVertexAttribDivisor = 0xffff;
props->maxVertexAttribDivisor = V3D_MAX_VERTEX_ATTRIB_DIVISOR;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR: {
VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR *props =
(VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR *)ext;
props->maxVertexAttribDivisor = 0xffff;
props->maxVertexAttribDivisor = V3D_MAX_VERTEX_ATTRIB_DIVISOR;
props->supportsNonZeroFirstInstance = true;
break;
}

View File

@ -616,7 +616,7 @@ pack_shader_state_attribute_record(struct v3dv_pipeline *pipeline,
attr.read_as_int_uint = desc->channel[0].pure_integer;
attr.instance_divisor = MIN2(pipeline->vb[binding].instance_divisor,
0xffff);
V3D_MAX_VERTEX_ATTRIB_DIVISOR);
attr.type = get_attr_type(desc);
}
}

View File

@ -374,7 +374,7 @@ v3d_vertex_state_create(struct pipe_context *pctx, unsigned num_elements,
attr.normalized_int_type = desc->channel[0].normalized;
attr.read_as_int_uint = desc->channel[0].pure_integer;
attr.instance_divisor = MIN2(elem->instance_divisor,
0xffff);
V3D_MAX_VERTEX_ATTRIB_DIVISOR);
switch (desc->channel[0].type) {
case UTIL_FORMAT_TYPE_FLOAT: