mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 20:10:14 +01:00
intel/brw: Also return the size of the assembled shader
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30062>
This commit is contained in:
parent
f6e7d1dca2
commit
6267585778
2 changed files with 13 additions and 1 deletions
|
|
@ -129,11 +129,22 @@ brw_assemble(void *mem_ctx, const struct intel_device_info *devinfo,
|
|||
}
|
||||
|
||||
result.bin = p->store;
|
||||
result.bin_size = p->next_insn_offset;
|
||||
result.inst_count = p->next_insn_offset / 16;
|
||||
|
||||
if ((flags & BRW_ASSEMBLE_COMPACT) != 0)
|
||||
if ((flags & BRW_ASSEMBLE_COMPACT) != 0) {
|
||||
brw_compact_instructions(p, 0, disasm_info);
|
||||
|
||||
/* Adjust bin size to account for compacted instructions. */
|
||||
int compacted = 0;
|
||||
for (int i = 0; i < result.inst_count; i++) {
|
||||
const brw_inst *inst = result.bin + i;
|
||||
if (brw_inst_cmpt_control(devinfo, inst))
|
||||
compacted++;
|
||||
}
|
||||
result.bin_size -= compacted * 8;
|
||||
}
|
||||
|
||||
ralloc_free(disasm_info);
|
||||
|
||||
end:
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ struct intel_device_info;
|
|||
|
||||
typedef struct {
|
||||
void *bin;
|
||||
int bin_size;
|
||||
int inst_count;
|
||||
} brw_assemble_result;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue