Commit Graph

17 Commits

Author SHA1 Message Date
Matt Turner 47a77ba839 glsl: Add C API for exec_node.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Matt Turner 5f90f2ee59 glsl: Move definition of exec_list member functions out of the struct.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Matt Turner cb5a0e59cf glsl: Move definition of exec_node member functions out of the struct.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Kenneth Graunke 277dbf08b0 glsl: Remove exec_list iterators now that nothing uses them.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:49:47 -08:00
Kenneth Graunke 48d0faaa43 glsl: Use a new foreach_two_lists macro for walking two lists at once.
When handling function calls, we often want to walk through the list of
formal parameters and list of actual parameters at the same time.
(Both are guaranteed to be the same length.)

Previously, we used a pattern of:

   exec_list_iterator 1st_iter = <1st list>.iterator();
   foreach_iter(exec_list_iterator, 2nd_iter, <2nd list>) {
      ...
      1st_iter.next();
   }

This was awkward, since you had to manually iterate through one of
the two lists.

This patch introduces a foreach_two_lists macro which safely walks
through two lists at the same time, so you can simply do:

   foreach_two_lists(1st_node, <1st list>, 2nd_node, <2nd list>) {
      ...
   }

v2: Rename macro from foreach_list2 to foreach_two_lists, as suggested
    by Ian Romanick.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 11:49:42 -08:00
Kenneth Graunke 81a3759bb5 glsl: Use the new DECLARE_R[Z]ALLOC_CXX_OPERATORS in a bunch of places.
This eliminates a lot of boilerplate and should be 100% equivalent.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-21 09:17:06 -07:00
Kenneth Graunke d3073f58c1 Convert everything from the talloc API to the ralloc API. 2011-01-31 10:17:09 -08:00
Brian Paul a5fd039672 exec_list: replace class with struct
To match the definition below.
2010-09-03 15:25:55 -06:00
Ian Romanick 79082b8aca exec_node: Add insert_before that inserts an entire list 2010-09-03 11:55:21 -07:00
Ian Romanick 29eebe9a9a exec_list: Add pop_head 2010-09-03 11:55:21 -07:00
Eric Anholt 62c4763b70 glsl2: Fix spelling of "sentinel." 2010-07-29 14:02:19 -07:00
Kenneth Graunke 61a44ccaef exec_list: Fix foreach_list_safe.
It now works correctly when nodes are removed, as it was originally
intended to do; it no longer processes nodes added to the list before
the current node, nor those added immediately after the current node.

This matches the behavior of Linux's list_for_each_safe.
2010-07-19 14:49:34 -07:00
Kenneth Graunke 1fdcdb2dca exec_list: Add a new replace_with method. 2010-07-14 16:49:24 -07:00
Kenneth Graunke f3290e950c glsl2: Add foreach_list_safe which works even when mutating the list.
In particular, with foreach_list_safe, one can remove and free the current
node without crashes; if new nodes are added after the current node,
they will be properly visited as well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-07-09 09:46:07 -07:00
Ian Romanick c44556317a exec_list: Add method to append one complete list to another 2010-07-07 12:41:26 -07:00
Eric Anholt 16b68b1952 glsl2: Move our data from a glsl_shader* on the side to the main gl_shader *.
This saves recompiling at link time.  gl_shader->ir is made a pointer
so that we don't have to bring exec_list into mtypes.h.
2010-06-30 11:30:26 -07:00
Eric Anholt 2928588267 glsl2: Move the compiler to the subdirectory it will live in in Mesa. 2010-06-24 15:36:00 -07:00
Renamed from list.h (Browse further)