Mesa (master): glsl: replace unreachable code path with assert

Timothy Arceri tarceri at kemper.freedesktop.org
Sun Jan 10 22:19:01 UTC 2016


Module: Mesa
Branch: master
Commit: 98270fd20d4d58db8ae5af3b6f10ed6a81c058a6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=98270fd20d4d58db8ae5af3b6f10ed6a81c058a6

Author: Timothy Arceri <timothy.arceri at collabora.com>
Date:   Fri Jan  8 15:25:37 2016 +1100

glsl: replace unreachable code path with assert

The lower_named_interface_blocks() pass is called before we try
assign locations to varyings so this shouldn't be reachable.

Reviewed-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>

---

 src/glsl/link_varyings.cpp |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 3853abd..7cc5880 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -1295,13 +1295,12 @@ public:
 
    void process(ir_variable *var)
    {
+      /* All named varying interface blocks should be flattened by now */
+      assert(!var->is_interface_instance());
+
       this->toplevel_var = var;
       this->varying_floats = 0;
-      if (var->is_interface_instance())
-         program_resource_visitor::process(var->get_interface_type(),
-                                           var->get_interface_type()->name);
-      else
-         program_resource_visitor::process(var);
+      program_resource_visitor::process(var);
    }
 
 private:




More information about the mesa-commit mailing list