nir_lower_mediump: Drop assertion about not containing movs.
authorEmma Anholt <emma@anholt.net>
Thu, 19 May 2022 20:26:33 +0000 (13:26 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 1 Jun 2022 22:19:44 +0000 (22:19 +0000)
A 1D texture operation may need to do a mov to turn a reference to a
channel of an SSA value into a scalar value to be passed as the texture
coordinate (since texture srcs can't do swizzles).  Seen in
amnesia-the-dark-descent/low/46.shader_test() for example, where a 1D
texture is used to remap each of r,g,b from a previous texture result.

Besides, the nir_op_is_vec() case will (perhaps surprisingly) look through
a mov, anyway.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>

src/compiler/nir/nir_lower_mediump.c

index 927b269..5c6f84e 100644 (file)
@@ -465,12 +465,6 @@ nir_fold_16bit_sampler_conversions(nir_shader *nir,
 
             nir_alu_type src_type = nir_tex_instr_src_type(tex, i);
 
-            if (src_alu->op == nir_op_mov) {
-               assert(!"The IR shouldn't contain any movs to make this pass"
-                       " effective.");
-               continue;
-            }
-
             /* Handle vector sources that are made of scalar instructions. */
             if (nir_op_is_vec(src_alu->op)) {
                /* See if the vector is made of f16->f32 opcodes. */