summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/nir/nir_draw_helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/nir/nir_draw_helpers.c')
-rw-r--r--src/gallium/auxiliary/nir/nir_draw_helpers.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/nir/nir_draw_helpers.c b/src/gallium/auxiliary/nir/nir_draw_helpers.c
index ad0d6d15ea1..2b362433f77 100644
--- a/src/gallium/auxiliary/nir/nir_draw_helpers.c
+++ b/src/gallium/auxiliary/nir/nir_draw_helpers.c
@@ -50,16 +50,9 @@ typedef struct {
static nir_ssa_def *
load_frag_coord(nir_builder *b)
{
- nir_foreach_shader_in_variable(var, b->shader) {
- if (var->data.location == VARYING_SLOT_POS)
- return nir_load_var(b, var);
- }
-
- nir_variable *pos = nir_variable_create(b->shader, nir_var_shader_in,
- glsl_vec4_type(), NULL);
- pos->data.location = VARYING_SLOT_POS;
+ nir_variable *pos = nir_get_variable_with_location(b->shader, nir_var_shader_in,
+ VARYING_SLOT_POS, glsl_vec4_type());
pos->data.interpolation = INTERP_MODE_NOPERSPECTIVE;
- pos->data.driver_location = b->shader->num_inputs++;
return nir_load_var(b, pos);
}