glsl: flatten a tautological conditional in lower_precision
authorMarek Olšák <marek.olsak@amd.com>
Fri, 26 Jun 2020 11:16:41 +0000 (07:16 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 8 Jul 2020 02:02:06 +0000 (22:02 -0400)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

src/compiler/glsl/lower_precision.cpp

index ff5e5104c3f80739c40782674426e49ddf391273..b2d8330a44dd0bf0481b58a1425ca11884d251af 100644 (file)
@@ -378,14 +378,11 @@ find_lowerable_rvalues_visitor::visit_enter(ir_texture *ir)
 {
    ir_hierarchical_visitor::visit_enter(ir);
 
-   if (stack.back().state == UNKNOWN) {
-      /* The precision of the sample value depends on the precision of the
-       * sampler.
-       */
-      stack.back().state = handle_precision(ir->type,
-                                            ir->sampler->precision());
-   }
-
+   /* The precision of the sample value depends on the precision of the
+    * sampler.
+    */
+   stack.back().state = handle_precision(ir->type,
+                                         ir->sampler->precision());
    return visit_continue;
 }