<div dir="ltr">+correct connor<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 3, 2017 at 5:12 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When NIR was first created, we were a bit lazy about numbers of components.<br>
The rule was that a source couldn't consume more components than the thing<br>
it was reading from.  However, this leads to a lot of confusion because you<br>
now have a thing sourcing from a vec4 but only reading two of the<br>
components.<br>
<br>
The solution to this is to disallow that case and require that the number<br>
of components always match.  The one exception is ALU instructions because<br>
they're designed to naturally swizzle things around like mad.  We already<br>
require this restriction for phi instructions.  This series adds it for<br>
intrinsics, texture instructions, and deref indirects.<br>
<br>
Cc: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
Cc: Connor Abbott <<a href="mailto:cwabbott0@gmaial.com">cwabbott0@gmaial.com</a>><br>
<br>
Jason Ekstrand (8):<br>
  nir/intrinsics: Make load_barycentric_input take a 2-component coor<br>
  nir/copy_prop: Respect the source's number of components<br>
  nir/spirv: Restrict the number of channels in texture coordinates<br>
  nir/lower_tex: Use tex_instr_dest_size for txs destinations<br>
  anv/apply_dynamic_offsets: Only use one channel for computed offsets<br>
  i965/fs: Use num_components from the SSA def in image intrinsics<br>
  nir: Make image_size a variable-width intrinsic<br>
  nir/validate: Validate that bit sizes and components always match<br>
<br>
 src/compiler/glsl/glsl_to_nir.<wbr>cpp                |   7 +-<br>
 src/compiler/nir/nir_<wbr>intrinsics.h                |   6 +-<br>
 src/compiler/nir/nir_lower_<wbr>tex.c                 |   3 +-<br>
 src/compiler/nir/nir_opt_copy_<wbr>propagate.c        | 129 +++++++++++++++++------<br>
 src/compiler/nir/nir_validate.<wbr>c                  | 101 +++++++++++-------<br>
 src/compiler/spirv/spirv_to_<wbr>nir.c                |  21 ++--<br>
 src/intel/vulkan/anv_nir_<wbr>apply_dynamic_offsets.c |   3 +-<br>
 src/mesa/drivers/dri/i965/brw_<wbr>fs_nir.cpp         |   3 +-<br>
 8 files changed, 185 insertions(+), 88 deletions(-)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.5.0.400.gff86faf<br>
<br>
</font></span></blockquote></div><br></div>