anv: implement VK_EXT_primitive_restart_index
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40776>
This commit is contained in:
Lionel Landwerlin 2026-03-19 13:32:05 +02:00 committed by Marge Bot
parent a4737d0430
commit 6031d52393
4 changed files with 9 additions and 3 deletions

View file

@ -1,6 +1,5 @@
# ../src/intel/common/intel_urb_config.c:173: intel_get_urb_config: Assertion `total_needs <= urb_chunks' failed.
dEQP-GLES31.functional.geometry_shading.basic.output_0_and_128,Crash
dEQP-GLES31.functional.geometry_shading.basic.output_128_and_0,Crash
dEQP-GLES31.functional.geometry_shading.basic.output_128,Crash
dEQP-GLES31.functional.geometry_shading.basic.output_max,Crash
dEQP-GLES31.functional.geometry_shading.basic.output_vary_by_attribute,Crash

View file

@ -947,6 +947,8 @@ void anv_CmdBindIndexBuffer2KHR(
cmd_buffer->state.gfx.dirty |= ANV_CMD_DIRTY_INDEX_TYPE;
}
vk_cmd_set_index_buffer_type(&cmd_buffer->vk, indexType);
uint64_t index_addr = buffer ?
anv_address_physical(anv_address_add(buffer->address, offset)) : 0;
uint32_t index_size = buffer ? vk_buffer_range(&buffer->vk, offset, size) : 0;

View file

@ -353,6 +353,7 @@ get_device_extensions(const struct anv_physical_device *device,
.EXT_present_timing = device->has_reg_timestamp,
#endif
.EXT_primitive_topology_list_restart = true,
.EXT_primitive_restart_index = true,
.EXT_primitives_generated_query = true,
.EXT_private_data = true,
.EXT_provoking_vertex = true,
@ -1019,6 +1020,9 @@ get_features(const struct anv_physical_device *pdevice,
/* VK_EXT_device_address_binding_report */
.reportAddressBinding = true,
/* VK_EXT_primitive_restart_index */
.primitiveRestartIndex = true,
};
/* The new DOOM and Wolfenstein games require depthBounds without

View file

@ -1723,7 +1723,7 @@ update_vf_restart(struct anv_gfx_dynamic_state *hw_state,
const struct anv_cmd_graphics_state *gfx)
{
SET(VF, vf.IndexedDrawCutIndexEnable, dyn->ia.primitive_restart_enable);
SET(VF, vf.CutIndex, vk_index_to_restart(gfx->index_type));
SET(VF, vf.CutIndex, dyn->ia.primitive_restart_index);
}
ALWAYS_INLINE static void
@ -2461,7 +2461,8 @@ cmd_buffer_flush_gfx_runtime_state(struct anv_gfx_dynamic_state *hw_state,
update_line_stipple(hw_state, dyn);
if ((gfx->dirty & ANV_CMD_DIRTY_INDEX_TYPE) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_IA_PRIMITIVE_RESTART_ENABLE))
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_IA_PRIMITIVE_RESTART_ENABLE) ||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_IA_PRIMITIVE_RESTART_INDEX))
update_vf_restart(hw_state, dyn, gfx);
if ((gfx->dirty & ANV_CMD_DIRTY_INDEX_BUFFER) ||