Age | Commit message (Collapse) | Author | Files | Lines |
|
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 propagating a 'ctx' parameter through these calls.
This fix happens to have no impact on glsl-orangebook-ch06-bump.frag,
(since it doesn't trigger any errors).
|
|
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!
|
|
This causes the following tests to pass:
glslparsertest/glsl2/constructor-10.vert
|
|
Store the thing in a variable and deref it for each swizzle if we have to.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
|
|
|
|
|
|
|
|
All of the cases (e.g., arrays and structures) that were being
filtered by these tests were already filtered by the earlier
is_numeric and is_boolean tests.
|
|
|
|
|
|
Eventually code that processes constant structure constructors will
need to use the processed list of parameters.
|
|
This causes the following tests to pass:
glslparsertest/shaders/CorrectMatComma2.frag
One of the incorrect errors in glslparsertest/shaders/CorrectComma.frag
is also eliminated.
|
|
|
|
During generation of calls to constructors, derefernce constants by creating
new constants instead of creating dereferences.
|
|
The previous code just had dumb cut-and-paste errors.
|
|
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.
|
|
|
|
Previously the list of function call parameters was stored as a
circular list in ast_expression::subexpressions[1]. They are now
stored as a regular list in ast_expression::expressions.
|
|
Also, change the name of the method to generate_constructor.
|
|
|
|
|
|
This causes the following tests to pass:
glslparsertest/shaders/function10.frag
|
|
Fixes constructor-09.glsl and CorrectParse2.frag.
|
|
|
|
|
|
process_call
These will be used in the functions that implement calls to array constructors.
|
|
|
|
This is the first baby step towards getting array constructors working.
|
|
This causes the following tests to pass:
glslparsertest/shaders/CorrectVersion.V110.frag
shaders/glsl-vs-sqrt-zero.frag
shaders/glsl-vs-sqrt-zero.vert
This causes the following tests to fail. These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.
glslparsertest/shaders/attribute1.vert
glslparsertest/shaders/attribute2.vert
glslparsertest/shaders/main2.vert
|
|
All of the scalar, vector, and matrix constructors *except* "from
bool" constructors should be handled. Array and structure
constructors are also not yet handled.
|
|
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
|
|
Right now, reject constructors for samplers because the are illegal.
|
|
|
|
This function will be used for matching some types of constructors as well.
|
|
|