From d0d5ef6139880c683642958394de7b9d72f09544 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 21 Jul 2020 11:18:29 -0500 Subject: [PATCH] nir/lower_two_sided_color: Use nir_variable_create Reviewed-by: Dave Airlie Part-of: --- src/compiler/nir/nir_lower_two_sided_color.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/compiler/nir/nir_lower_two_sided_color.c b/src/compiler/nir/nir_lower_two_sided_color.c index 700d759d27f..aa0d9fe84b2 100644 --- a/src/compiler/nir/nir_lower_two_sided_color.c +++ b/src/compiler/nir/nir_lower_two_sided_color.c @@ -51,18 +51,15 @@ static nir_variable * create_input(nir_shader *shader, gl_varying_slot slot, enum glsl_interp_mode interpolation) { - nir_variable *var = rzalloc(shader, nir_variable); + nir_variable *var = nir_variable_create(shader, nir_var_shader_in, + glsl_vec4_type(), NULL); var->data.driver_location = shader->num_inputs++; - var->type = glsl_vec4_type(); - var->data.mode = nir_var_shader_in; var->name = ralloc_asprintf(var, "in_%d", var->data.driver_location); var->data.index = 0; var->data.location = slot; var->data.interpolation = interpolation; - exec_list_push_tail(&shader->inputs, &var->node); - return var; } @@ -74,18 +71,14 @@ create_face_input(nir_shader *shader) return var; } - nir_variable *var = rzalloc(shader, nir_variable); + nir_variable *var = nir_variable_create(shader, nir_var_shader_in, + glsl_bool_type(), "gl_FrontFacing"); var->data.driver_location = shader->num_inputs++; - var->type = glsl_bool_type(); - var->data.mode = nir_var_shader_in; - var->name = "gl_FrontFacing"; var->data.index = 0; var->data.location = VARYING_SLOT_FACE; var->data.interpolation = INTERP_MODE_FLAT; - exec_list_push_tail(&shader->inputs, &var->node); - return var; } -- 2.30.2