nir: Offset vertex_id by first_vertex instead of base_vertex
base_vertex will be zero for non-indexed calls and in that case we need vertex_id to be offset by the ‘first’ parameter instead. That is what we get with first_vertex. This is true for both GL and Vulkan. The freedreno driver is also setting vertex_id_zero_based on nir_options. In order to avoid breakage this patch switches the relevant code to handle SYSTEM_VALUE_FIRST_VERTEX so that it can retain the same behavior. v2: change a3xx/fd3_emit.c and a4xx/fd4_emit.c from SYSTEM_VALUE_BASE_VERTEX to SYSTEM_VALUE_FIRST_VERTEX (Kenneth). Reviewed-by:Ian Romanick <ian.d.romanick@intel.com> Cc: Rob Clark <robdclark@gmail.com> Acked-by:
Marek Olšák <marek.olsak@amd.com>
- src/compiler/nir/nir_lower_system_values.c 1 addition, 1 deletionsrc/compiler/nir/nir_lower_system_values.c
- src/gallium/drivers/freedreno/a3xx/fd3_emit.c 1 addition, 1 deletionsrc/gallium/drivers/freedreno/a3xx/fd3_emit.c
- src/gallium/drivers/freedreno/a4xx/fd4_emit.c 1 addition, 1 deletionsrc/gallium/drivers/freedreno/a4xx/fd4_emit.c
- src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c 2 additions, 3 deletionssrc/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
- src/intel/vulkan/genX_cmd_buffer.c 0 additions, 4 deletionssrc/intel/vulkan/genX_cmd_buffer.c
- src/intel/vulkan/genX_pipeline.c 1 addition, 3 deletionssrc/intel/vulkan/genX_pipeline.c