nir: Add a nir->info.uses_interp_var_at_offset flag.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 13 May 2016 06:53:13 +0000 (23:53 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 16 May 2016 06:50:28 +0000 (23:50 -0700)
I've added this to nir_gather_info(), but also to glsl_to_nir() as a
temporary measure, since the i965 GL driver today doesn't use
nir_gather_info() yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/glsl_to_nir.cpp
src/compiler/nir/nir.h
src/compiler/nir/nir_gather_info.c

index 8a256506f8f72326569d7706e383a9e437301b51..d28fe41ad84253bcaf533cdebede504d890714c1 100644 (file)
@@ -1277,6 +1277,9 @@ nir_visitor::visit(ir_expression *ir)
           intrin->intrinsic == nir_intrinsic_interp_var_at_sample)
          intrin->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[1]));
 
+      if (intrin->intrinsic == nir_intrinsic_interp_var_at_offset)
+         shader->info.uses_interp_var_at_offset = true;
+
       unsigned bit_size =  glsl_get_bit_size(deref->type);
       add_instr(&intrin->instr, deref->type->vector_elements, bit_size);
 
index 2227910eae1d24e2011d2e0d3efbc483617c3778..cb9d44abafb4955487c55d656111e784b4d99858 100644 (file)
@@ -1716,6 +1716,9 @@ typedef struct nir_shader_info {
    /* Whether or not this shader ever uses textureGather() */
    bool uses_texture_gather;
 
+   /** Whether or not this shader uses nir_intrinsic_interp_var_at_offset */
+   bool uses_interp_var_at_offset;
+
    /* Whether or not this shader uses the gl_ClipDistance output */
    bool uses_clip_distance_out;
 
index 89a6302d4fca5c0179feebd9d29e207de43345f8..7900fd1ef55a0dfa8ffab59ebb79de3a4b36131a 100644 (file)
@@ -56,6 +56,10 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader)
       shader->info.gs.uses_end_primitive = 1;
       break;
 
+   case nir_intrinsic_interp_var_at_offset:
+      shader->info.uses_interp_var_at_offset = 1;
+      break;
+
    default:
       break;
    }