• Kenneth Graunke's avatar
    glsl: Make lower_constant_arrays_to_uniforms require dereferences. · 60f011af
    Kenneth Graunke authored
    Ilia noticed that my lowering pass was converting the constant array
    used by textureGatherOffsets' offsets parameter to a uniform.  This
    broke textureGather for Nouveau, and is generally a horrible plan,
    since it violates the GLSL constraint that offsets must be an
    immediate constant.
    
    When I wrote this pass, I neglected to consider whole array assignment.
    I figured opt_array_splitting would handle constant indexing, so this
    pass was really about fixing variable indexing.
    
    textureGatherOffsets is an example of whole array access that we really
    don't want to touch.  Whole array copies don't appear to benefit from
    this either - they're most likely initializers for temporary arrays
    which are going to be mutated anyway.  Since you're copying, you may
    as well copy from immediates, not uniforms.
    
    This patch makes the pass look for ir_dereference_arrays of
    ir_constants, rather than looking for any ir_constant directly.
    This way, it ignores whole array assignment.
    
    No shader-db changes or Piglit regressions on Haswell.  Some Piglit
    tests generate different code (fixing textureGatherOffsets on Nouveau).
    Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
    Tested-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
    Cc: "10.4" <mesa-stable@lists.freedesktop.org>
    60f011af
Name
Last commit
Last update
bin Loading commit data...
docs Loading commit data...
doxygen Loading commit data...
include Loading commit data...
m4 Loading commit data...
scons Loading commit data...
src Loading commit data...
.dir-locals.el Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
Android.common.mk Loading commit data...
Android.mk Loading commit data...
CleanSpec.mk Loading commit data...
Makefile.am Loading commit data...
SConstruct Loading commit data...
VERSION Loading commit data...
autogen.sh Loading commit data...
common.py Loading commit data...
configure.ac Loading commit data...
install-gallium-links.mk Loading commit data...
install-lib-links.mk Loading commit data...