nir: fix missing increments of num_inputs/num_outputs
authorRob Clark <robclark@freedesktop.org>
Wed, 4 Nov 2015 21:10:52 +0000 (16:10 -0500)
committerRob Clark <robclark@freedesktop.org>
Fri, 20 Nov 2015 01:03:32 +0000 (20:03 -0500)
Note: not quite perfect, we should use type_size vfunc (in
compiler_options or nir_shader?) to determine how much we
increment num_inputs/outputs/uniforms.  But we don't have
that yet, so let's at least fix things for the existing
users of these passes.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/glsl/nir/nir_lower_clip.c
src/glsl/nir/nir_lower_two_sided_color.c

index 31ccfb2c02b5b0da97e3f31c8b755d8b7b5cc4c1..c58c7785b3fa8ce99890cc4b8f4f3bb6a4131bc5 100644 (file)
@@ -55,9 +55,11 @@ create_clipdist_var(nir_shader *shader, unsigned drvloc,
 
    if (output) {
       exec_list_push_tail(&shader->outputs, &var->node);
+      shader->num_outputs++; /* TODO use type_size() */
    }
    else {
       exec_list_push_tail(&shader->inputs, &var->node);
+      shader->num_inputs++;  /* TODO use type_size() */
    }
    return var;
 }
index db519bf513b56cc8b9d63d9394a2645ddfffd295..6995b9d6bc192af10eff9c42f330294797675d88 100644 (file)
@@ -60,6 +60,8 @@ create_input(nir_shader *shader, unsigned drvloc, gl_varying_slot slot)
 
    exec_list_push_tail(&shader->inputs, &var->node);
 
+   shader->num_inputs++;     /* TODO use type_size() */
+
    return var;
 }