nir: Add a cubemap normalizing pass
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 2 Apr 2015 23:38:30 +0000 (16:38 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 3 Apr 2015 21:12:49 +0000 (14:12 -0700)
commit52e718097fa7dc808b3e8b43a8fd14a5b2b64797
tree6c78714e75762396a9b1446f24fbb67cb77a7bb7
parentbff421332661bfd0f82ab9eee9e4fec9d06ed1a1
nir: Add a cubemap normalizing pass

This commit adds a pass to L1-normalize cube-map coordinates.  Some hardware
such as i965 requires that largest cube-map coordinate is +-1.  We had a
pass to perform this normalization in GLSL IR but we need it in NIR for
cube maps on ARB programs to work correctly.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
v2 (Suggested by Eric):
 - Do a vector fabs and split into components later
 - Move to core NIR

Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/Makefile.sources
src/glsl/nir/nir.h
src/glsl/nir/nir_normalize_cubemap_coords.c [new file with mode: 0644]