<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 13, 2016 at 1:42 AM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It would probably make more sense to set this from nir_gather_info()<br>
in case we manage to dead code eliminate these intrinsics. However,<br>
we haven't transitioned the GL driver to using that pass yet...<br></blockquote><div><br></div><div>Please add it anyway so nir_gather_info doesn't get out-of-date.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
src/compiler/nir/glsl_to_nir.cpp | 3 +++<br>
src/compiler/nir/nir.h | 3 +++<br>
2 files changed, 6 insertions(+)<br>
<br>
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp<br>
index fb1d421..e82d98a 100644<br>
--- a/src/compiler/nir/glsl_to_nir.cpp<br>
+++ b/src/compiler/nir/glsl_to_nir.cpp<br>
@@ -1276,6 +1276,9 @@ nir_visitor::visit(ir_expression *ir)<br>
intrin->intrinsic == nir_intrinsic_interp_var_at_sample)<br>
intrin->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[1]));<br>
<br>
+ if (intrin->intrinsic == nir_intrinsic_interp_var_at_offset)<br>
+ shader->info.uses_interp_var_at_offset = true;<br>
+<br>
unsigned bit_size = glsl_get_bit_size(deref->type);<br>
add_instr(&intrin->instr, deref->type->vector_elements, bit_size);<br>
<br>
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h<br>
index 20927a2..d12792d 100644<br>
--- a/src/compiler/nir/nir.h<br>
+++ b/src/compiler/nir/nir.h<br>
@@ -1710,6 +1710,9 @@ typedef struct nir_shader_info {<br>
/* Whether or not this shader ever uses textureGather() */<br>
bool uses_texture_gather;<br>
<br>
+ /** Whether or not this shader uses nir_intrinsic_interp_var_at_offset */<br>
+ bool uses_interp_var_at_offset;<br>
+<br>
/* Whether or not this shader uses the gl_ClipDistance output */<br>
bool uses_clip_distance_out;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.8.2<br>
<br>
</font></span></blockquote></div><br></div></div>