brw: Remove builtin sources from brw_inst

A later patch will add a different mechanism to achieve the same
goal.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730>
This commit is contained in:
Caio Oliveira 2025-08-09 15:22:47 -07:00 committed by Marge Bot
parent 858162a2fc
commit c81c8c917f
2 changed files with 6 additions and 36 deletions

View file

@ -84,10 +84,7 @@ brw_inst::brw_inst(const brw_inst &that)
static void
initialize_sources(brw_inst *inst, const brw_reg src[], uint8_t num_sources)
{
if (num_sources > ARRAY_SIZE(inst->builtin_src))
inst->src = ralloc_array(inst, brw_reg, num_sources);
else
inst->src = inst->builtin_src;
inst->src = ralloc_array(inst, brw_reg, num_sources);
for (unsigned i = 0; i < num_sources; i++)
inst->src[i] = src[i];
@ -98,42 +95,16 @@ initialize_sources(brw_inst *inst, const brw_reg src[], uint8_t num_sources)
void
brw_inst::resize_sources(uint8_t num_sources)
{
if (this->sources == num_sources)
return;
if (this->sources < num_sources) {
brw_reg *new_src = ralloc_array(this, brw_reg, num_sources);
brw_reg *old_src = this->src;
brw_reg *new_src;
for (unsigned i = 0; i < this->sources; i++)
new_src[i] = this->src[i];
const unsigned builtin_size = ARRAY_SIZE(this->builtin_src);
if (old_src == this->builtin_src) {
if (num_sources > builtin_size) {
new_src = ralloc_array(this, brw_reg, num_sources);
for (unsigned i = 0; i < this->sources; i++)
new_src[i] = old_src[i];
} else {
new_src = old_src;
}
} else {
if (num_sources <= builtin_size) {
new_src = this->builtin_src;
assert(this->sources > num_sources);
for (unsigned i = 0; i < num_sources; i++)
new_src[i] = old_src[i];
} else if (num_sources < this->sources) {
new_src = old_src;
} else {
new_src = ralloc_array(this, brw_reg, num_sources);
for (unsigned i = 0; i < this->sources; i++)
new_src[i] = old_src[i];
}
this->src = new_src;
}
this->sources = num_sources;
this->src = new_src;
}
bool

View file

@ -221,7 +221,6 @@ public:
brw_reg dst;
brw_reg *src;
brw_reg builtin_src[4];
#ifndef NDEBUG
/** @{