v3d/compiler: implement nir_intrinsic_load_base_instance
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 8 Apr 2020 06:49:36 +0000 (08:49 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:29 +0000 (21:21 +0000)
commitf41857eb489710e2fdbd3bbbe311b92c0d87ea16
treec57f53bbe9408c8249d021569caf7d2817e83915
parentee917d2b78a2e19f88076bf1da2c99e95cdf1966
v3d/compiler: implement nir_intrinsic_load_base_instance

Vulkan lowers gl_InstanceIndex to load_base_instance +
load_instance_id, so we need to implement loading the base instance in
the compiler.

The base instance is set by the BASE_VERTEX_BASE_INSTANCE command
right before the instanced draw call and it is included in the VPM
payload together with the InstanceID and VertexID if this is requested
by the shader record.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/vir.c