freedreno/ir3: allow inputs with the same location
turnip can have multiple inputs with the same location, and different location_frac. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3109>
This commit is contained in:
@@ -2704,7 +2704,7 @@ setup_input(struct ir3_context *ctx, nir_variable *in)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
so->inputs[n].slot = slot;
|
so->inputs[n].slot = slot;
|
||||||
so->inputs[n].compmask = (1 << (ncomp + frac)) - 1;
|
so->inputs[n].compmask |= (1 << (ncomp + frac)) - 1;
|
||||||
so->inputs_count = MAX2(so->inputs_count, n + 1);
|
so->inputs_count = MAX2(so->inputs_count, n + 1);
|
||||||
so->inputs[n].interpolate = in->data.interpolation;
|
so->inputs[n].interpolate = in->data.interpolation;
|
||||||
|
|
||||||
@@ -2767,17 +2767,25 @@ setup_input(struct ir3_context *ctx, nir_variable *in)
|
|||||||
ctx->inputs[idx] = instr;
|
ctx->inputs[idx] = instr;
|
||||||
}
|
}
|
||||||
} else if (ctx->so->type == MESA_SHADER_VERTEX) {
|
} else if (ctx->so->type == MESA_SHADER_VERTEX) {
|
||||||
/* We shouldn't have fractional input for VS input.. that only shows
|
struct ir3_instruction *input = NULL, *in;
|
||||||
* up with varying packing
|
struct ir3_instruction *components[4];
|
||||||
*/
|
unsigned mask = (1 << (ncomp + frac)) - 1;
|
||||||
assert(frac == 0);
|
|
||||||
|
|
||||||
struct ir3_instruction *input = create_input(ctx, (1 << ncomp) - 1);
|
foreach_input(in, ctx->ir) {
|
||||||
struct ir3_instruction *components[ncomp];
|
if (in->input.inidx == n) {
|
||||||
|
input = in;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
input->input.inidx = n;
|
if (!input) {
|
||||||
|
input = create_input(ctx, mask);
|
||||||
|
input->input.inidx = n;
|
||||||
|
} else {
|
||||||
|
input->regs[0]->wrmask |= mask;
|
||||||
|
}
|
||||||
|
|
||||||
ir3_split_dest(ctx->block, components, input, 0, ncomp);
|
ir3_split_dest(ctx->block, components, input, frac, ncomp);
|
||||||
|
|
||||||
for (int i = 0; i < ncomp; i++) {
|
for (int i = 0; i < ncomp; i++) {
|
||||||
unsigned idx = (n * 4) + i + frac;
|
unsigned idx = (n * 4) + i + frac;
|
||||||
|
Reference in New Issue
Block a user