summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/nir/nir_draw_helpers.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-09-22 01:35:23 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-09-22 01:35:23 +0000
commit27e7bb02bd0f89f96d9e3b402b46c2c97ee4defe (patch)
tree274247cd9317896d1f4f7b12d469b85dbbae9205 /lib/mesa/src/gallium/auxiliary/nir/nir_draw_helpers.c
parent294c26e88dc461cbb485be73fd6624ec386b4f0b (diff)
Import Mesa 20.0.8
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/nir/nir_draw_helpers.c')
-rw-r--r--lib/mesa/src/gallium/auxiliary/nir/nir_draw_helpers.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/nir/nir_draw_helpers.c b/lib/mesa/src/gallium/auxiliary/nir/nir_draw_helpers.c
index 33fdf4aee..7a6936d63 100644
--- a/lib/mesa/src/gallium/auxiliary/nir/nir_draw_helpers.c
+++ b/lib/mesa/src/gallium/auxiliary/nir/nir_draw_helpers.c
@@ -49,16 +49,20 @@ typedef struct {
static nir_ssa_def *
load_frag_coord(nir_builder *b)
{
+ int max_driver_loc = -1;
nir_foreach_variable(var, &b->shader->inputs) {
if (var->data.location == VARYING_SLOT_POS)
return nir_load_var(b, var);
+ if (max_driver_loc < (int)var->data.driver_location)
+ max_driver_loc = var->data.driver_location;
}
nir_variable *pos = nir_variable_create(b->shader, nir_var_shader_in,
glsl_vec4_type(), NULL);
pos->data.location = VARYING_SLOT_POS;
pos->data.interpolation = INTERP_MODE_NOPERSPECTIVE;
- pos->data.driver_location = b->shader->num_inputs++;
+ pos->data.driver_location = max_driver_loc + 1;
+ b->shader->num_inputs++;
return nir_load_var(b, pos);
}