mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 05:10:17 +01:00
freedreno/rnn: Fix addvariant being set effectively once
Each time addvariant was added it was added to the end of ctx->vars list, without previous variant being removed. While the check for variant tests only the first one that has expected enum name. Fix this by updating `variant` instead of appending new one if variant with such enum already exists. Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23881>
This commit is contained in:
parent
148f214dae
commit
15db60fbbc
1 changed files with 2 additions and 6 deletions
|
|
@ -48,11 +48,7 @@ int rnndec_varadd(struct rnndeccontext *ctx, char *varset, const char *variant)
|
|||
int i, j;
|
||||
for (i = 0; i < en->valsnum; i++)
|
||||
if (!strcasecmp(en->vals[i]->name, variant)) {
|
||||
struct rnndecvariant *ci = calloc (sizeof *ci, 1);
|
||||
ci->en = en;
|
||||
ci->variant = i;
|
||||
ADDARRAY(ctx->vars, ci);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == en->valsnum) {
|
||||
|
|
@ -67,7 +63,7 @@ int rnndec_varadd(struct rnndeccontext *ctx, char *varset, const char *variant)
|
|||
}
|
||||
}
|
||||
|
||||
if (i == ctx->varsnum) {
|
||||
if (j == ctx->varsnum) {
|
||||
struct rnndecvariant *ci = calloc (sizeof *ci, 1);
|
||||
ci->en = en;
|
||||
ci->variant = i;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue