v3dv: emit instanced draw calls when requested
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 8 Apr 2020 07:39:04 +0000 (09:39 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:29 +0000 (21:21 +0000)
commit56b611a9cf29447a5b750a965adc0235d0e9eb68
tree1e909de0afd02f0c62e3d537c502571c8554a4fb
parentf41857eb489710e2fdbd3bbbe311b92c0d87ea16
v3dv: emit instanced draw calls when requested

This requires that we emit a specific draw command and that we emit
the base instance if not zero right before the instanced draw call.
Notice that we were already doing this for instanced indexed draw
calls, so here we are only adding this for non-indexed draw calls.

We also need to flag whether the vertex shader reads the base instance
in the shader record (which it will if it reads uses gl_InstanceIndex,
as that is lowered in Vulkan to base_instance + instance_id).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
src/broadcom/vulkan/v3dv_cmd_buffer.c
src/broadcom/vulkan/v3dv_pipeline.c