panvk: Enable VK_KHR_vertex_attribute_divisor

Panvk currently enables VK_EXT_vertex_attribute_divisor, but Mali HW
does not support a non-zero firstInstance when a divisor is used.
supportsNonZeroFirstInstance is correctly set to false to advertise
this, however this property was only added when the extension was
promoted. Thus we need to remove support for
VK_EXT_vertex_attribute_divisor and enable
VK_KHR_vertex_attribute_divisor instead.

Also fixes an issue with non-zero divisor for v10.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32137>
This commit is contained in:
John Anthony 2024-11-13 14:30:11 +01:00 committed by Marge Bot
parent 5e40ccf979
commit 653808c209
5 changed files with 10 additions and 21 deletions

View file

@ -556,7 +556,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_KHR_surface_protected_capabilities DONE (anv, lvp, nvk, radv, tu, v3dv, vn)
VK_KHR_swapchain DONE (anv, dzn, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_KHR_swapchain_mutable_format DONE (anv, hasvk, lvp, nvk, radv, tu, v3dv, vn)
VK_KHR_vertex_attribute_divisor DONE (anv, nvk, radv, tu, v3dv)
VK_KHR_vertex_attribute_divisor DONE (anv, nvk, panvk, radv, tu, v3dv)
VK_KHR_wayland_surface DONE (anv, dzn, lvp, nvk, panvk, radv, tu, v3dv, vn)
VK_KHR_workgroup_memory_explicit_layout DONE (anv, nvk, hasvk, radv, tu, v3dv)
VK_KHR_win32_keyed_mutex not started
@ -645,7 +645,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_EXT_surface_maintenance1 DONE (anv, lvp, nvk, radv, tu, v3dv)
VK_EXT_swapchain_maintenance1 DONE (anv, lvp, nvk, radv, tu, v3dv)
VK_EXT_transform_feedback DONE (anv, hasvk, lvp, nvk, radv, tu, vn)
VK_EXT_vertex_attribute_divisor DONE (anv, dzn, hasvk, lvp, nvk, panvk, radv, tu, v3dv, vn)
VK_EXT_vertex_attribute_divisor DONE (anv, dzn, hasvk, lvp, nvk, radv, tu, v3dv, vn)
VK_EXT_vertex_input_dynamic_state DONE (anv, lvp, nvk, radv, tu, vn)
VK_EXT_ycbcr_image_arrays DONE (anv, hasvk, lvp, nvk, radv)
VK_ANDROID_external_memory_android_hardware_buffer DONE (anv, radv, tu, vn)

View file

@ -474,30 +474,14 @@ dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.multiple_interpolatio
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.multiple_interpolation.separate.no_sample_decoration.4_samples,Fail
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.multiple_interpolation.structured.no_sample_decoration.1_sample,Fail
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.multiple_interpolation.structured.no_sample_decoration.4_samples,Fail
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw.non_zero.16,Fail
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw.non_zero.2,Fail
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw_indexed.non_zero.16,Fail
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw_indexed.non_zero.2,Fail
dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.multiple_interpolation.separate.no_sample_decoration.1_sample,Fail
dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.multiple_interpolation.separate.no_sample_decoration.4_samples,Fail
dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.multiple_interpolation.structured.no_sample_decoration.1_sample,Fail
dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.multiple_interpolation.structured.no_sample_decoration.4_samples,Fail
dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw.non_zero.16,Fail
dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw.non_zero.2,Fail
dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw_indexed.non_zero.16,Fail
dEQP-VK.draw.dynamic_rendering.partial_secondary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw_indexed.non_zero.2,Fail
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.multiple_interpolation.separate.no_sample_decoration.1_sample,Fail
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.multiple_interpolation.separate.no_sample_decoration.4_samples,Fail
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.multiple_interpolation.structured.no_sample_decoration.1_sample,Fail
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.multiple_interpolation.structured.no_sample_decoration.4_samples,Fail
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw.non_zero.16,Fail
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw.non_zero.2,Fail
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw_indexed.non_zero.2,Fail
dEQP-VK.draw.renderpass.vertex_attribute_divisor.ext.static_pipeline.draw.non_zero.16,Fail
dEQP-VK.draw.renderpass.vertex_attribute_divisor.ext.static_pipeline.draw.non_zero.2,Fail
dEQP-VK.draw.renderpass.vertex_attribute_divisor.ext.static_pipeline.draw_indexed.non_zero.16,Fail
dEQP-VK.draw.renderpass.vertex_attribute_divisor.ext.static_pipeline.draw_indexed.non_zero.2,Fail
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.2_cmdbuffers_resuming,Fail
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.2_secondary_2_primary_cmdbuffers_resuming,Fail

View file

@ -19,7 +19,6 @@ dEQP-VK.binding_model.shader_access.primary_cmd_buf.bind.sampler_immutable.fragm
dEQP-VK.binding_model.shader_access.primary_cmd_buf.bind.with_template.sampler_immutable.tess_eval.multiple_arbitrary_descriptors.2d
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.instanced.draw_vk_primitive_topology_point_list
dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.vertex_attribute_divisor.ext.static_pipeline.draw_indexed.non_zero.16
dEQP-VK.dynamic_rendering.graphics_pipeline_library.dedicated_allocation.formats.r16g16b16a16_uint.input.dont_care.store.self_dep_draw

View file

@ -89,6 +89,12 @@ emit_vs_attrib(const struct vk_vertex_attribute_state *attrib_info,
} else if (buf_info->divisor == 1) {
cfg.attribute_type = MALI_ATTRIBUTE_TYPE_1D;
cfg.frequency = MALI_ATTRIBUTE_FREQUENCY_INSTANCE;
} else if (buf_info->divisor == 0) {
cfg.attribute_type = MALI_ATTRIBUTE_TYPE_1D;
/* HW doesn't support a zero divisor, but we can achieve the same by
* not using a divisor and setting the stride to zero */
cfg.frequency = MALI_ATTRIBUTE_FREQUENCY_INSTANCE;
cfg.stride = 0;
} else if (util_is_power_of_two_or_zero(buf_info->divisor)) {
/* Per-instance, POT divisor */
cfg.attribute_type = MALI_ATTRIBUTE_TYPE_1D_POT_DIVISOR;

View file

@ -225,6 +225,7 @@ get_device_extensions(const struct panvk_physical_device *device,
.KHR_synchronization2 = true,
.KHR_timeline_semaphore = true,
.KHR_variable_pointers = true,
.KHR_vertex_attribute_divisor = true,
.KHR_zero_initialize_workgroup_memory = true,
.EXT_buffer_device_address = true,
.EXT_custom_border_color = true,
@ -244,7 +245,6 @@ get_device_extensions(const struct panvk_physical_device *device,
.EXT_sampler_filter_minmax = arch >= 10,
.EXT_shader_module_identifier = true,
.EXT_tooling_info = true,
.EXT_vertex_attribute_divisor = true,
.GOOGLE_decorate_string = true,
.GOOGLE_hlsl_functionality1 = true,
.GOOGLE_user_type = true,
@ -370,7 +370,7 @@ get_features(const struct panvk_physical_device *device,
/* VK_KHR_index_type_uint8 */
.indexTypeUint8 = true,
/* VK_EXT_vertex_attribute_divisor */
/* VK_KHR_vertex_attribute_divisor */
.vertexAttributeInstanceRateDivisor = true,
.vertexAttributeInstanceRateZeroDivisor = true,