Mesa (main): nir_lower_mediump: Drop assertion about not containing movs.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 1 23:05:10 UTC 2022


Module: Mesa
Branch: main
Commit: 6e087f96c9830da07a0c788d94d2af6112a4425e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e087f96c9830da07a0c788d94d2af6112a4425e

Author: Emma Anholt <emma at anholt.net>
Date:   Thu May 19 13:26:33 2022 -0700

nir_lower_mediump: Drop assertion about not containing movs.

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 at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>

---

 src/compiler/nir/nir_lower_mediump.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/compiler/nir/nir_lower_mediump.c b/src/compiler/nir/nir_lower_mediump.c
index 927b2692dc6..5c6f84ec9be 100644
--- a/src/compiler/nir/nir_lower_mediump.c
+++ b/src/compiler/nir/nir_lower_mediump.c
@@ -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. */



More information about the mesa-commit mailing list