broadcom/vc5: Add support for loading varyings in V3D 4.1.
The LDVARY signal now writes an arbitrary register, so I took out the magic src register file and replaced it with an instruction with LDVARY set so we have somewhere to hang a QFILE_TEMP destination for register allocation.
This commit is contained in:
@@ -395,9 +395,20 @@ static struct qreg
|
|||||||
emit_fragment_varying(struct v3d_compile *c, nir_variable *var,
|
emit_fragment_varying(struct v3d_compile *c, nir_variable *var,
|
||||||
uint8_t swizzle)
|
uint8_t swizzle)
|
||||||
{
|
{
|
||||||
struct qreg vary = vir_reg(QFILE_VARY, ~0);
|
struct qreg r3 = vir_reg(QFILE_MAGIC, V3D_QPU_WADDR_R3);
|
||||||
struct qreg r5 = vir_reg(QFILE_MAGIC, V3D_QPU_WADDR_R5);
|
struct qreg r5 = vir_reg(QFILE_MAGIC, V3D_QPU_WADDR_R5);
|
||||||
|
|
||||||
|
struct qreg vary;
|
||||||
|
if (c->devinfo->ver >= 41) {
|
||||||
|
struct qinst *ldvary = vir_add_inst(V3D_QPU_A_NOP, c->undef,
|
||||||
|
c->undef, c->undef);
|
||||||
|
ldvary->qpu.sig.ldvary = true;
|
||||||
|
vary = vir_emit_def(c, ldvary);
|
||||||
|
} else {
|
||||||
|
vir_NOP(c)->qpu.sig.ldvary = true;
|
||||||
|
vary = r3;
|
||||||
|
}
|
||||||
|
|
||||||
/* For gl_PointCoord input or distance along a line, we'll be called
|
/* For gl_PointCoord input or distance along a line, we'll be called
|
||||||
* with no nir_variable, and we don't count toward VPM size so we
|
* with no nir_variable, and we don't count toward VPM size so we
|
||||||
* don't track an input slot.
|
* don't track an input slot.
|
||||||
|
@@ -73,7 +73,6 @@ enum qfile {
|
|||||||
* or physical registers later.
|
* or physical registers later.
|
||||||
*/
|
*/
|
||||||
QFILE_TEMP,
|
QFILE_TEMP,
|
||||||
QFILE_VARY,
|
|
||||||
QFILE_UNIF,
|
QFILE_UNIF,
|
||||||
QFILE_TLB,
|
QFILE_TLB,
|
||||||
QFILE_TLBU,
|
QFILE_TLBU,
|
||||||
|
@@ -110,6 +110,7 @@ vir_has_side_effects(struct v3d_compile *c, struct qinst *inst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (inst->qpu.sig.ldtmu ||
|
if (inst->qpu.sig.ldtmu ||
|
||||||
|
inst->qpu.sig.ldvary ||
|
||||||
inst->qpu.sig.wrtmuc ||
|
inst->qpu.sig.wrtmuc ||
|
||||||
inst->qpu.sig.thrsw) {
|
inst->qpu.sig.thrsw) {
|
||||||
return true;
|
return true;
|
||||||
@@ -210,7 +211,6 @@ vir_writes_r3(const struct v3d_device_info *devinfo, struct qinst *inst)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < vir_get_nsrc(inst); i++) {
|
for (int i = 0; i < vir_get_nsrc(inst); i++) {
|
||||||
switch (inst->src[i].file) {
|
switch (inst->src[i].file) {
|
||||||
case QFILE_VARY:
|
|
||||||
case QFILE_VPM:
|
case QFILE_VPM:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
@@ -29,7 +29,6 @@ vir_print_reg(struct v3d_compile *c, struct qreg reg)
|
|||||||
{
|
{
|
||||||
static const char *files[] = {
|
static const char *files[] = {
|
||||||
[QFILE_TEMP] = "t",
|
[QFILE_TEMP] = "t",
|
||||||
[QFILE_VARY] = "v",
|
|
||||||
[QFILE_UNIF] = "u",
|
[QFILE_UNIF] = "u",
|
||||||
[QFILE_TLB] = "tlb",
|
[QFILE_TLB] = "tlb",
|
||||||
[QFILE_TLBU] = "tlbu",
|
[QFILE_TLBU] = "tlbu",
|
||||||
|
@@ -78,12 +78,6 @@ has_nonremovable_reads(struct v3d_compile *c, struct qinst *inst)
|
|||||||
if (total_size == 1)
|
if (total_size == 1)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dead code removal of varyings is tricky, so just assert
|
|
||||||
* that it all happened at the NIR level.
|
|
||||||
*/
|
|
||||||
if (inst->src[i].file == QFILE_VARY)
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -189,12 +189,6 @@ v3d_generate_code_block(struct v3d_compile *c,
|
|||||||
|
|
||||||
src[i] = qpu_acc(5);
|
src[i] = qpu_acc(5);
|
||||||
break;
|
break;
|
||||||
case QFILE_VARY:
|
|
||||||
temp = new_qpu_nop_before(qinst);
|
|
||||||
temp->qpu.sig.ldvary = true;
|
|
||||||
|
|
||||||
src[i] = qpu_acc(3);
|
|
||||||
break;
|
|
||||||
case QFILE_SMALL_IMM:
|
case QFILE_SMALL_IMM:
|
||||||
abort(); /* XXX */
|
abort(); /* XXX */
|
||||||
#if 0
|
#if 0
|
||||||
@@ -255,7 +249,6 @@ v3d_generate_code_block(struct v3d_compile *c,
|
|||||||
dst = qpu_magic(V3D_QPU_WADDR_TLBU);
|
dst = qpu_magic(V3D_QPU_WADDR_TLBU);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QFILE_VARY:
|
|
||||||
case QFILE_UNIF:
|
case QFILE_UNIF:
|
||||||
case QFILE_SMALL_IMM:
|
case QFILE_SMALL_IMM:
|
||||||
case QFILE_LOAD_IMM:
|
case QFILE_LOAD_IMM:
|
||||||
|
Reference in New Issue
Block a user