glsl/nir_opt_access: Update uniforms correctly when only vars change
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 19 Jun 2019 18:39:24 +0000 (11:39 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 19 Jun 2019 19:50:41 +0000 (12:50 -0700)
commitfeb0cdcb5249f60522ce024c578b92f11d5269bd
treedf2dd9c3280b534e637b2aeda011e36368375f3b
parentd7ea433a5fc13ef1f622fddf01afb1f1de7bc6b4
glsl/nir_opt_access: Update uniforms correctly when only vars change

Even if only variables access flags are changed, the existing NIR
infrastructure expects metadata to be explicitly preserved, so do
that.  Don't care about avoiding preserve to be called twice since the
cost is negligible.

This scenario can be triggered by dead variables, and also by other
intrinsics that read the variables -- but not cause progress to be
made when processing the intrinsics.

Fixes: f2d0e48ddc7 "glsl/nir: Add optimization pass for access flags"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/gl_nir_opt_access.c