Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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)
|
|
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!
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
Also, change the name of the method to generate_constructor.
|
|
|
|
Query the type of a structure field
|
|
A refactor turned 'i' into '1', meaning everything writemasked into
the y component.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
This will let us know the length of function bodies for the purpose of
inlining (among other uses).
|
|
|
|
ir_function_signature now has a pointer back to the ir_function that owns it.
|
|
Generates a symbol table entry and the IR approximation of a prototype for a
type's constructor. Currently only arrays are supported.
|
|
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.
|
|
|
|
Since all glsl_type objects are flyweights, support is added to track all
known array types. This accounts for most of the changes.
|
|
Fixes main3.vert.
|
|
|
|
|
|
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>
|
|
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
|
|
Currently only vector and matrix types are supported. Structure types will be
added later.
|
|
This function has been completely replaced by glsl_type::get_instance.
|
|
Gets the singleton corresponding to a particular scalar, vector, or
matrix type.
|
|
Retreives the glsl_type that corresponds to the base type of a numeric scalar /
vector / matrix type. So vec4 returns float, etc.
|
|
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.
|
|
|
|
Among other benefits, this cleans up a the hackery invovled in
initializing the union field in builtin_types.h.
|