mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
vc4: Initialize the various qreg arrays when allocating them.
This is particularly important for outputs, where we try to MOV the whole vec4 to the VPM, even if only 1-3 components had been set up. It might also be important for temporaries, if the shader reads components before writing them.
This commit is contained in:
parent
b44a7a3223
commit
b0256fb75f
1 changed files with 4 additions and 0 deletions
|
|
@ -73,12 +73,16 @@ resize_qreg_array(struct vc4_compile *c,
|
||||||
if (*size >= decl_size)
|
if (*size >= decl_size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
uint32_t old_size = *size;
|
||||||
*size = MAX2(*size * 2, decl_size);
|
*size = MAX2(*size * 2, decl_size);
|
||||||
*regs = reralloc(c, *regs, struct qreg, *size);
|
*regs = reralloc(c, *regs, struct qreg, *size);
|
||||||
if (!*regs) {
|
if (!*regs) {
|
||||||
fprintf(stderr, "Malloc failure\n");
|
fprintf(stderr, "Malloc failure\n");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (uint32_t i = old_size; i < *size; i++)
|
||||||
|
(*regs)[i] = c->undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct qreg
|
static struct qreg
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue