Commit graph

16 commits

Author SHA1 Message Date
Carl Worth
1660a29547 exec_node: Add new talloc-based new()
And fix all callers to use the tallbac-based new for exec_node
construction. We make ready use of talloc_parent in order to get
valid, (and appropriate) talloc owners for everything we construct
without having to add new 'ctx' parameters up and down all the call
trees.

This closes the majority of the memory leaks in the
glsl-orangebook-ch06-bump.frag test:

	total heap usage: 55,623 allocs, 42,672 frees
	(was 14,533 frees)

Now 76.7% leak-free. Woo-hoo!
2010-06-23 18:59:35 -07:00
Eric Anholt
ac95f2f8c8 Include stdio.h and stdlib.h everywhere, and don't cook our own #define NULL. 2010-06-22 12:30:55 -07:00
Ian Romanick
70fe8b6663 Begin refactoring ir_dereference
Create separate subclasses of ir_dereference for variable, array, and
record dereferences.  As a side effect, array and record dereferences
no longer point to ir_variable objects directly.  Instead they each
point to an ir_dereference_variable object.

This is the first of several steps in the refactoring process.  The
intention is that ir_dereference will eventually become an abstract
base class.
2010-05-26 15:23:19 -07:00
Ian Romanick
6efaeeea44 Convert structure field dereferences to HIR 2010-04-28 18:22:54 -07:00
Ian Romanick
a43817a483 Use glsl_type::is_error instead of comparison with glsl_error_type pointer 2010-03-26 14:27:23 -07:00
Kenneth Graunke
affc1413ac Move swizzles out of ir_dereference and into their own class.
Also turn generate_swizzle into a static "create" method of the new
class; we'll want to use it for the IR reader as well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 14:00:59 -07:00
Kenneth Graunke
fb9fb5f51d Add new abstract ir_rvalue class; rework accordingly.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 13:58:48 -07:00
Ian Romanick
c4e2627045 Use glsl_type::get_instance instead of _mesa_glsl_get_vector_type 2010-03-24 17:46:39 -07:00
Ian Romanick
4d184a1d02 Fix typo in swizzle processing loop
One of the accesses to str in the loop used str[0] instead of str[i].

Reported-by: Kenneth Graunke
2010-03-24 15:27:50 -07:00
Ian Romanick
9e97ffb754 Trivial cleanups in generate_swizzle
Add 'const' and 'static const' in a couple of places.
2010-03-24 15:27:04 -07:00
Ian Romanick
afbe26fd61 Use ir_dereference::set_swizzle 2010-03-24 15:25:23 -07:00
Ian Romanick
a2dd22fb19 Convert is_glsl_type_vector to glsl_type::is_vector 2010-03-09 15:55:16 -08:00
Ian Romanick
0044e7edce Conver IR structures to use exec_list instead of simple_node 2010-03-08 23:44:54 -08:00
Ian Romanick
18238de6c3 Make AST->HIR conversion a method of ast_node, re-enable 2010-03-01 13:49:10 -08:00
Ian Romanick
168890ce1b Convert to new interfaces so that it will compile
Convert TRUE and FALSE to true and false.  Convert
_mesa_ast_get_location to ast_node::get_location.
2010-02-25 12:24:40 -08:00
Ian Romanick
d5f4f09e76 Rename .cc files to .cpp 2010-02-22 18:43:08 -08:00
Renamed from hir_field_selection.cc (Browse further)