From: Eric Anholt Date: Thu, 22 Mar 2018 20:52:11 +0000 (-0700) Subject: broadcom/vc5: Account for InstanceID/VertexID in VPM segment size. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d7a015cbc6a6c12a87ee7ec725cc399d3712f43c;p=mesa.git broadcom/vc5: Account for InstanceID/VertexID in VPM segment size. Fixes failure in GTF-GLES3.gtf.GL3Tests.draw_instanced.draw_instanced_attrib_size --- diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index ff9405e6c12..93990ee806f 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -728,15 +728,20 @@ uint64_t *v3d_compile_vs(const struct v3d_compiler *compiler, prog_data->vpm_input_size += c->vattr_sizes[i]; } - /* Input/output segment size are in 8x32-bit multiples. */ - prog_data->vpm_input_size = align(prog_data->vpm_input_size, 8) / 8; - prog_data->vpm_output_size = align(c->num_vpm_writes, 8) / 8; - prog_data->uses_vid = (s->info.system_values_read & (1ull << SYSTEM_VALUE_VERTEX_ID)); prog_data->uses_iid = (s->info.system_values_read & (1ull << SYSTEM_VALUE_INSTANCE_ID)); + if (prog_data->uses_vid) + prog_data->vpm_input_size++; + if (prog_data->uses_iid) + prog_data->vpm_input_size++; + + /* Input/output segment size are in 8x32-bit multiples. */ + prog_data->vpm_input_size = align(prog_data->vpm_input_size, 8) / 8; + prog_data->vpm_output_size = align(c->num_vpm_writes, 8) / 8; + return v3d_return_qpu_insts(c, final_assembly_size); }