brw: Move brw_prog_data_init to a different file
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

The generator code will be reworked, remove this unrelated
function from there.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41458>
This commit is contained in:
Caio Oliveira 2026-04-22 14:59:31 -07:00 committed by Marge Bot
parent 2273533504
commit 46cd7b6e28
4 changed files with 16 additions and 16 deletions

View file

@ -1546,19 +1546,6 @@ brw_generator::get_assembly()
return brw_get_program(p, &prog_data->program_size);
}
void brw_prog_data_init(struct brw_stage_prog_data *prog_data,
const struct brw_compile_params *params)
{
/* Do not memset the structure to 0, the driver might have put some bits of
* information in there.
*/
prog_data->ray_queries = params->nir->info.ray_queries;
prog_data->stage = params->nir->info.stage;
prog_data->source_hash = params->source_hash;
prog_data->total_scratch = 0;
prog_data->total_shared = params->nir->info.shared_size;
}
/* After program generation, go back and update the UIP and JIP of
* BREAK, CONT, ENDIF and HALT instructions to their correct locations.
*/

View file

@ -74,6 +74,3 @@ private:
mesa_shader_stage stage;
void *mem_ctx;
};
void brw_prog_data_init(struct brw_stage_prog_data *prog_data,
const struct brw_compile_params *params);

View file

@ -154,4 +154,7 @@ int brw_simd_select_for_workgroup_size(const struct intel_device_info *devinfo,
bool brw_should_print_shader(const nir_shader *shader, uint64_t debug_flag, uint32_t source_hash);
void brw_prog_data_init(struct brw_stage_prog_data *prog_data,
const struct brw_compile_params *params);
#endif // __cplusplus

View file

@ -1048,3 +1048,16 @@ brw_allocate_vgrf_units(brw_shader &s, unsigned units_of_REGSIZE)
{
return brw_vgrf(brw_allocate_vgrf_number(s, units_of_REGSIZE), BRW_TYPE_UD);
}
void brw_prog_data_init(struct brw_stage_prog_data *prog_data,
const struct brw_compile_params *params)
{
/* Do not memset the structure to 0, the driver might have put some bits of
* information in there.
*/
prog_data->ray_queries = params->nir->info.ray_queries;
prog_data->stage = params->nir->info.stage;
prog_data->source_hash = params->source_hash;
prog_data->total_scratch = 0;
prog_data->total_shared = params->nir->info.shared_size;
}