brw: Allocate only brw_inst for BASE instructions

Now that all the other kinds were added, all transforms to SEND will
come from non-BASE kinds, so we don't need overallocate for BASE
instructions.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
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-29 22:36:59 -07:00 committed by Marge Bot
parent 08c0f33874
commit 8ded571ef4

View file

@ -21,12 +21,12 @@ brw_inst_kind_size(brw_inst_kind kind)
STATIC_ASSERT(sizeof(brw_send_inst) >= sizeof(brw_urb_inst));
STATIC_ASSERT(sizeof(brw_send_inst) >= sizeof(brw_fb_write_inst));
/* TODO: Temporarily here to ensure all instructions can be converted to
* SEND. Once all new kinds are added, change so that BASE allocate only
* sizeof(brw_inst).
/* To allow transforming from other non-BASE kinds to a SEND, make
* it so that enough space is always allocated.
*/
return sizeof(brw_send_inst);
return kind == BRW_KIND_BASE ? sizeof(brw_inst)
: sizeof(brw_send_inst);
}
static brw_inst *