mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 04:00:12 +01:00
freedreno/a3xx: use new shader linkage helper
Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
98c83b5d1c
commit
7a59157287
1 changed files with 16 additions and 27 deletions
|
|
@ -151,7 +151,7 @@ fd3_program_emit(struct fd_ringbuffer *ring, struct fd3_emit *emit,
|
|||
uint32_t fpbuffersz, vpbuffersz, fsoff;
|
||||
uint32_t pos_regid, posz_regid, psize_regid, color_regid[4] = {0};
|
||||
int constmode;
|
||||
int i, j, k;
|
||||
int i, j;
|
||||
|
||||
debug_assert(nr <= ARRAY_SIZE(color_regid));
|
||||
|
||||
|
|
@ -275,45 +275,34 @@ fd3_program_emit(struct fd_ringbuffer *ring, struct fd3_emit *emit,
|
|||
A3XX_SP_VS_PARAM_REG_PSIZEREGID(psize_regid) |
|
||||
A3XX_SP_VS_PARAM_REG_TOTALVSOUTVAR(fp->varying_in));
|
||||
|
||||
for (i = 0, j = -1; (i < 8) && (j < (int)fp->inputs_count); i++) {
|
||||
struct ir3_shader_linkage l = {0};
|
||||
ir3_link_shaders(&l, vp, fp);
|
||||
|
||||
for (i = 0, j = 0; (i < 16) && (j < l.cnt); i++) {
|
||||
uint32_t reg = 0;
|
||||
|
||||
OUT_PKT0(ring, REG_A3XX_SP_VS_OUT_REG(i), 1);
|
||||
|
||||
j = ir3_next_varying(fp, j);
|
||||
if (j < fp->inputs_count) {
|
||||
k = ir3_find_output(vp, fp->inputs[j].slot);
|
||||
reg |= A3XX_SP_VS_OUT_REG_A_REGID(vp->outputs[k].regid);
|
||||
reg |= A3XX_SP_VS_OUT_REG_A_COMPMASK(fp->inputs[j].compmask);
|
||||
}
|
||||
reg |= A3XX_SP_VS_OUT_REG_A_REGID(l.var[j].regid);
|
||||
reg |= A3XX_SP_VS_OUT_REG_A_COMPMASK(l.var[j].compmask);
|
||||
j++;
|
||||
|
||||
j = ir3_next_varying(fp, j);
|
||||
if (j < fp->inputs_count) {
|
||||
k = ir3_find_output(vp, fp->inputs[j].slot);
|
||||
reg |= A3XX_SP_VS_OUT_REG_B_REGID(vp->outputs[k].regid);
|
||||
reg |= A3XX_SP_VS_OUT_REG_B_COMPMASK(fp->inputs[j].compmask);
|
||||
}
|
||||
reg |= A3XX_SP_VS_OUT_REG_B_REGID(l.var[j].regid);
|
||||
reg |= A3XX_SP_VS_OUT_REG_B_COMPMASK(l.var[j].compmask);
|
||||
j++;
|
||||
|
||||
OUT_RING(ring, reg);
|
||||
}
|
||||
|
||||
for (i = 0, j = -1; (i < 4) && (j < (int)fp->inputs_count); i++) {
|
||||
for (i = 0, j = 0; (i < 8) && (j < l.cnt); i++) {
|
||||
uint32_t reg = 0;
|
||||
|
||||
OUT_PKT0(ring, REG_A3XX_SP_VS_VPC_DST_REG(i), 1);
|
||||
|
||||
j = ir3_next_varying(fp, j);
|
||||
if (j < fp->inputs_count)
|
||||
reg |= A3XX_SP_VS_VPC_DST_REG_OUTLOC0(fp->inputs[j].inloc);
|
||||
j = ir3_next_varying(fp, j);
|
||||
if (j < fp->inputs_count)
|
||||
reg |= A3XX_SP_VS_VPC_DST_REG_OUTLOC1(fp->inputs[j].inloc);
|
||||
j = ir3_next_varying(fp, j);
|
||||
if (j < fp->inputs_count)
|
||||
reg |= A3XX_SP_VS_VPC_DST_REG_OUTLOC2(fp->inputs[j].inloc);
|
||||
j = ir3_next_varying(fp, j);
|
||||
if (j < fp->inputs_count)
|
||||
reg |= A3XX_SP_VS_VPC_DST_REG_OUTLOC3(fp->inputs[j].inloc);
|
||||
reg |= A3XX_SP_VS_VPC_DST_REG_OUTLOC0(l.var[j++].loc);
|
||||
reg |= A3XX_SP_VS_VPC_DST_REG_OUTLOC1(l.var[j++].loc);
|
||||
reg |= A3XX_SP_VS_VPC_DST_REG_OUTLOC2(l.var[j++].loc);
|
||||
reg |= A3XX_SP_VS_VPC_DST_REG_OUTLOC3(l.var[j++].loc);
|
||||
|
||||
OUT_RING(ring, reg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue