summaryrefslogtreecommitdiff
path: root/glsl_types.cpp
AgeCommit message (Collapse)Author
2010-06-23glsl_type: Add a talloc-based newCarl Worth
And hook it up at the two sites it's called. Note that with this change we still don't use glsl_type* objects as talloc contexts, (see things like get_array_instance that accept both a talloc 'ctx' as well as a glsl_type*). The reason for this is that the code is still using many instance of glsl_type objects not created with new. This closes 3 leaks in the glsl-orangebook-ch06-bump.frag test: total heap usage: 55,623 allocs, 55,618 Leaving only 5 leaks to go.
2010-06-23Close memory leaks in glsl_type (constructor and get_array_instance)Carl Worth
Add a talloc ctx to both get_array_instance and the glsl_type constructor in order to be able to call talloc_size instead of malloc. This fix now makes glsl-orangebook-ch06-bump.frag 99.99% leak free: total heap usage: 55,623 allocs, 55,615 Only 8 missing frees now.
2010-06-23Close memory leaks from generate_constructor_introCarl Worth
By simply propagating a 'ctx' parameter through these function calls. (We do this because these function are otherwise only receiving an exec_list, which is not a valid talloc context.) This closes 1611 leaks in the glsl-orangebook-ch06-bump.frag test: total heap usage: 55,623 allocs, 44,283 frees (was 42,672 frees)
2010-06-23exec_node: Add new talloc-based new()Carl Worth
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-23Avoid using the same ir_constant 0.0 multiple times in mat constructors.Eric Anholt
2010-06-23glsl_type: Add method to get number of slots used by a typeIan Romanick
2010-06-11Use statically typed ir_constant constructors wherever possibleIan Romanick
2010-06-11Add glsl_types::field_index to get the location of a record fieldIan Romanick
2010-06-09Add EXT_texture_array support.Kenneth Graunke
2010-05-26Begin refactoring ir_dereferenceIan Romanick
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-04-28glsl_type::generate_constructor_prototype now generates the function tooIan Romanick
Also, change the name of the method to generate_constructor.
2010-04-28Support structures in glsl_type::generate_constructor_prototypeIan Romanick
2010-04-28Add glsl_type::field_typeIan Romanick
Query the type of a structure field
2010-04-23Fix the swizzling of vector constructors from scalars.Eric Anholt
A refactor turned 'i' into '1', meaning everything writemasked into the y component.
2010-04-22Fix illegal (var_ref (array_ref ...)) in matrix constructors.Kenneth Graunke
2010-04-21Emit body for constructors in the right place.Kenneth Graunke
Previously, the body of some vector constructors were added to the wrong function signature, and the body of matrix constructors were just being dumped in the main instruction stream.
2010-04-21Refactor IR function representation.Kenneth Graunke
Now, ir_function is emitted as part of the IR instructions, rather than simply existing in the symbol table. Individual ir_function_signatures are not emitted themselves, but only as part of ir_function.
2010-04-07Make function bodies rely on the parameter variable declarations.Eric Anholt
Previously, generating inlined function bodies was going to be difficult, as there was no mapping between the body's declaration of variables where parameter values were supposed to live and the parameter variables that a caller would use in paramater setup. Presumably this also have been a problem for actual codegen.
2010-04-07Put function bodies under function signatures, instead of flat in the parent.Eric Anholt
This will let us know the length of function bodies for the purpose of inlining (among other uses).
2010-04-07Treat texture rectangles as an extension that is enabled be defaultIan Romanick
2010-03-31Use ir_function::add_signature to create link between function and signatureIan Romanick
ir_function_signature now has a pointer back to the ir_function that owns it.
2010-03-31Add glsl_type::generate_constructor_prototypeIan Romanick
Generates a symbol table entry and the IR approximation of a prototype for a type's constructor. Currently only arrays are supported.
2010-03-31Fix big dumbness in glsl_type::get_array_instanceIan Romanick
hash_table_insert needs to keep the key so that it compare keys on a following hash_table_find call. Since key was allocated on the stack, it disappeared out from under the hash table.
2010-03-31glsl_type array constructor generate a real name for the typeIan Romanick
2010-03-30Implement array type handlingIan Romanick
Since all glsl_type objects are flyweights, support is added to track all known array types. This accounts for most of the changes.
2010-03-29Reject main() declarations with a non-void return value.Eric Anholt
Fixes main3.vert.
2010-03-26Be sure to set ir_function_signature::definition for constructorsIan Romanick
2010-03-26Make glsl_*_type glsl_type class static dataIan Romanick
2010-03-26Move swizzles out of ir_dereference and into their own class.Kenneth Graunke
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-26Add new abstract ir_rvalue class; rework accordingly.Kenneth Graunke
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-25Add functions to generate constructors for built-in types.Ian Romanick
Currently only vector and matrix types are supported. Structure types will be added later.
2010-03-24Remove unused _mesa_glsl_get_vector_typeIan Romanick
This function has been completely replaced by glsl_type::get_instance.
2010-03-24Add glsl_type::get_instance methodIan Romanick
Gets the singleton corresponding to a particular scalar, vector, or matrix type.
2010-03-23Add glsl_type::get_base_type queryIan Romanick
Retreives the glsl_type that corresponds to the base type of a numeric scalar / vector / matrix type. So vec4 returns float, etc.
2010-03-23Add `void' type to table of available typesIan Romanick
This will make void-01.glsl test fail, so I may regret this later. However, this will make supporting functions that return void or functions that have a void parameter list easier to handle.
2010-03-19Use glsl_symbol_table instead of using _mesa_symbol_table directlyIan Romanick
2010-03-09Make glsl_type a classIan Romanick
Among other benefits, this cleans up a the hackery invovled in initializing the union field in builtin_types.h.