nir: add some nir_parameter fields

These will be used in future to do more validation on functions as
the glsl nir linker is expanded. The first use is in the following
patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27841>
This commit is contained in:
Timothy Arceri
2024-02-27 11:26:29 +11:00
committed by Marge Bot
parent 4ed4058910
commit edf242f825
2 changed files with 11 additions and 0 deletions

View File

@@ -660,12 +660,17 @@ nir_visitor::create_function(ir_function_signature *ir)
/* The return value is a variable deref (basically an out parameter) */
func->params[np].num_components = 1;
func->params[np].bit_size = 32;
func->params[np].type = ir->return_type;
func->params[np].is_return = true;
np++;
}
foreach_in_list(ir_variable, param, &ir->parameters) {
func->params[np].num_components = 1;
func->params[np].bit_size = 32;
func->params[np].type = param->type;
func->params[np].is_return = false;
np++;
}
assert(np == func->num_params);

View File

@@ -3468,6 +3468,12 @@ nir_cf_list_is_empty_block(struct exec_list *cf_list)
typedef struct {
uint8_t num_components;
uint8_t bit_size;
/* True if this paramater is actually the function return variable */
bool is_return;
/* The type of the function param */
const struct glsl_type *type;
} nir_parameter;
typedef struct nir_function {