[Mesa-dev] [PATCH 0/8] nir: Require numbers of components to always match
Connor Abbott
cwabbott0 at gmail.com
Thu Mar 9 06:20:52 UTC 2017
I agree that this is a good idea. For the series:
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
On Fri, Mar 3, 2017 at 8:12 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> When NIR was first created, we were a bit lazy about numbers of components.
> The rule was that a source couldn't consume more components than the thing
> it was reading from. However, this leads to a lot of confusion because you
> now have a thing sourcing from a vec4 but only reading two of the
> components.
>
> The solution to this is to disallow that case and require that the number
> of components always match. The one exception is ALU instructions because
> they're designed to naturally swizzle things around like mad. We already
> require this restriction for phi instructions. This series adds it for
> intrinsics, texture instructions, and deref indirects.
>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Connor Abbott <cwabbott0 at gmaial.com>
>
> Jason Ekstrand (8):
> nir/intrinsics: Make load_barycentric_input take a 2-component coor
> nir/copy_prop: Respect the source's number of components
> nir/spirv: Restrict the number of channels in texture coordinates
> nir/lower_tex: Use tex_instr_dest_size for txs destinations
> anv/apply_dynamic_offsets: Only use one channel for computed offsets
> i965/fs: Use num_components from the SSA def in image intrinsics
> nir: Make image_size a variable-width intrinsic
> nir/validate: Validate that bit sizes and components always match
>
> src/compiler/glsl/glsl_to_nir.cpp | 7 +-
> src/compiler/nir/nir_intrinsics.h | 6 +-
> src/compiler/nir/nir_lower_tex.c | 3 +-
> src/compiler/nir/nir_opt_copy_propagate.c | 129 +++++++++++++++++------
> src/compiler/nir/nir_validate.c | 101 +++++++++++-------
> src/compiler/spirv/spirv_to_nir.c | 21 ++--
> src/intel/vulkan/anv_nir_apply_dynamic_offsets.c | 3 +-
> src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 3 +-
> 8 files changed, 185 insertions(+), 88 deletions(-)
>
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list