diff options
author | Jason Ekstrand <[email protected]> | 2017-09-29 11:05:55 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-10-12 22:39:30 -0700 |
commit | 2db9470d88bb4856152465f44fa090f1a1bbf039 (patch) | |
tree | 5a00400eccf88ba22690d8a90610d8fece603f49 /src/intel | |
parent | c0435b204a51ae2d3409416fe11122f3b7c88bc3 (diff) |
intel/compiler: Add a helper for growing the prog_data::param array
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/compiler/brw_compiler.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index 26e8f464ef6..e2046581278 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -28,6 +28,7 @@ #include "common/gen_device_info.h" #include "main/mtypes.h" #include "main/macros.h" +#include "util/ralloc.h" #ifdef __cplusplus extern "C" { @@ -603,6 +604,18 @@ struct brw_stage_prog_data { uint32_t *pull_param; }; +static inline uint32_t * +brw_stage_prog_data_add_params(struct brw_stage_prog_data *prog_data, + unsigned nr_new_params) +{ + unsigned old_nr_params = prog_data->nr_params; + prog_data->nr_params += nr_new_params; + prog_data->param = reralloc(ralloc_parent(prog_data->param), + prog_data->param, uint32_t, + prog_data->nr_params); + return prog_data->param + old_nr_params; +} + static inline void brw_mark_surface_used(struct brw_stage_prog_data *prog_data, unsigned surf_index) |