nir: add always_active_io to nir variable
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 11 Sep 2017 06:19:22 +0000 (16:19 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 26 Sep 2017 12:37:02 +0000 (22:37 +1000)
Will be used in nir link pass to decided if we can remove a varying
or not.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
src/compiler/glsl/glsl_to_nir.cpp
src/compiler/nir/nir.h

index 99df6e0baf5c68e4d8b8bd042a565046db88d997..ce8da1ce438367610cd82fcf6bb026a94b8cbadd 100644 (file)
@@ -315,6 +315,7 @@ nir_visitor::visit(ir_variable *ir)
    var->type = ir->type;
    var->name = ralloc_strdup(var, ir->name);
 
+   var->data.always_active_io = ir->data.always_active_io;
    var->data.read_only = ir->data.read_only;
    var->data.centroid = ir->data.centroid;
    var->data.sample = ir->data.sample;
index 8330e6d7ce7e28ab7f0ca3e59278be98319e07ce..fab2110f6199ceee5400f1274798ab046a44de65 100644 (file)
@@ -191,6 +191,16 @@ typedef struct nir_variable {
       unsigned patch:1;
       unsigned invariant:1;
 
+      /**
+       * When separate shader programs are enabled, only input/outputs between
+       * the stages of a multi-stage separate program can be safely removed
+       * from the shader interface. Other input/outputs must remains active.
+       *
+       * This is also used to make sure xfb varyings that are unused by the
+       * fragment shader are not removed.
+       */
+      unsigned always_active_io:1;
+
       /**
        * Interpolation mode for shader inputs / outputs
        *