broadcom/compiler: clarify use of QFILE_VPM

This was only used for version < 40 (See commit 22a02f3e3).

Adding some extra explanations and asserts of places where it is used.

As we are here also move the definition of a register with QFILE_VPM,
to avoid defining it if not needed.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22984>
This commit is contained in:
Alejandro Piñeiro 2023-05-12 14:04:56 +02:00 committed by Marge Bot
parent 0cd9f0c3d3
commit dfdbf5bf94
3 changed files with 4 additions and 2 deletions

View file

@ -2197,14 +2197,13 @@ ntq_emit_vpm_read(struct v3d_compile *c,
uint32_t *remaining,
uint32_t vpm_index)
{
struct qreg vpm = vir_reg(QFILE_VPM, vpm_index);
if (c->devinfo->ver >= 40 ) {
return vir_LDVPMV_IN(c,
vir_uniform_ui(c,
(*num_components_queued)++));
}
struct qreg vpm = vir_reg(QFILE_VPM, vpm_index);
if (*num_components_queued != 0) {
(*num_components_queued)--;
return vir_MOV(c, vpm);

View file

@ -99,6 +99,8 @@ enum qfile {
/**
* VPM reads use this with an index value to say what part of the VPM
* is being read.
*
* Used only for ver < 40. For ver >= 40 we use ldvpm.
*/
QFILE_VPM,

View file

@ -230,6 +230,7 @@ v3d_generate_code_block(struct v3d_compile *c,
break;
case QFILE_VPM:
assert(c->devinfo->ver < 40);
assert((int)qinst->src[i].index >=
last_vpm_read_index);
(void)last_vpm_read_index;