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:

committed by
Marge Bot

parent
4ed4058910
commit
edf242f825
@@ -660,12 +660,17 @@ nir_visitor::create_function(ir_function_signature *ir)
|
|||||||
/* The return value is a variable deref (basically an out parameter) */
|
/* The return value is a variable deref (basically an out parameter) */
|
||||||
func->params[np].num_components = 1;
|
func->params[np].num_components = 1;
|
||||||
func->params[np].bit_size = 32;
|
func->params[np].bit_size = 32;
|
||||||
|
func->params[np].type = ir->return_type;
|
||||||
|
func->params[np].is_return = true;
|
||||||
np++;
|
np++;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach_in_list(ir_variable, param, &ir->parameters) {
|
foreach_in_list(ir_variable, param, &ir->parameters) {
|
||||||
func->params[np].num_components = 1;
|
func->params[np].num_components = 1;
|
||||||
func->params[np].bit_size = 32;
|
func->params[np].bit_size = 32;
|
||||||
|
|
||||||
|
func->params[np].type = param->type;
|
||||||
|
func->params[np].is_return = false;
|
||||||
np++;
|
np++;
|
||||||
}
|
}
|
||||||
assert(np == func->num_params);
|
assert(np == func->num_params);
|
||||||
|
@@ -3468,6 +3468,12 @@ nir_cf_list_is_empty_block(struct exec_list *cf_list)
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t num_components;
|
uint8_t num_components;
|
||||||
uint8_t bit_size;
|
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;
|
} nir_parameter;
|
||||||
|
|
||||||
typedef struct nir_function {
|
typedef struct nir_function {
|
||||||
|
Reference in New Issue
Block a user