summaryrefslogtreecommitdiff
path: root/ast_function.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-06-23Close memory leaks in glsl_type (constructor and get_array_instance)Carl Worth1-1/+2
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 leak in ir_call::get_error_instruction.Carl Worth1-15/+17
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).
2010-06-23exec_node: Add new talloc-based new()Carl Worth1-22/+31
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-23Generate errors for empty constructors instead of assertingIan Romanick1-1/+8
This causes the following tests to pass: glslparsertest/glsl2/constructor-10.vert
2010-06-23Fix multiple usage of an rvalue in constructor component splitting.Eric Anholt1-3/+23
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>
2010-06-22Include stdio.h and stdlib.h everywhere, and don't cook our own #define NULL.Eric Anholt1-1/+0
2010-06-11Use statically typed ir_constant constructors wherever possibleIan Romanick1-3/+8
2010-06-11Matrix and vector constructors with a single constant scalar are constantIan Romanick1-4/+119
2010-06-11Remove redundant type checks for constant constructorsIan Romanick1-3/+0
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.
2010-06-11Do simple constant folding while processing function call parametersIan Romanick1-1/+5
2010-06-11Detect and process constant record constructorsIan Romanick1-0/+55
2010-06-11Move parameter processing out of match_function_by_nameIan Romanick1-11/+9
Eventually code that processes constant structure constructors will need to use the processed list of parameters.
2010-06-11Constant-fold constructor parameters after type conversionIan Romanick1-8/+14
This causes the following tests to pass: glslparsertest/shaders/CorrectMatComma2.frag One of the incorrect errors in glslparsertest/shaders/CorrectComma.frag is also eliminated.
2010-06-11Make constructors with all constant parameters generate in-line constantsIan Romanick1-2/+29
2010-06-11Derefence components of constants smarterIan Romanick1-0/+7
During generation of calls to constructors, derefernce constants by creating new constants instead of creating dereferences.
2010-06-11Use ir_unop_b2i when converting a bool-to-int and add a missing breakIan Romanick1-1/+2
The previous code just had dumb cut-and-paste errors.
2010-05-26Begin refactoring ir_dereferenceIan Romanick1-1/+1
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-10Convert ast_node use of simple_node to exec_list and exec_nodeIan Romanick1-11/+10
2010-05-10Store AST function call parameters in expressionsIan Romanick1-73/+65
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.
2010-04-28glsl_type::generate_constructor_prototype now generates the function tooIan Romanick1-3/+2
Also, change the name of the method to generate_constructor.
2010-04-07Clarify the types of various exec_list in ir.hEric Anholt1-5/+3
2010-04-02Use glsl_type::element_type to get the type of array elementsIan Romanick1-1/+1
2010-04-02Ensure that 'in' and 'inout' formal parameters are valid lvaluesIan Romanick1-0/+31
This causes the following tests to pass: glslparsertest/shaders/function10.frag
2010-04-02Add bool/int conversion as IR operations.Eric Anholt1-1/+1
Fixes constructor-09.glsl and CorrectParse2.frag.
2010-04-02Add conversion of bool to float as an IR operation to match int to float.Eric Anholt1-1/+1
2010-03-31Generate array constructor callsIan Romanick1-1/+73
2010-03-31Refactor parts of match_function_by_name into process_parameters and ↵Ian Romanick1-22/+49
process_call These will be used in the functions that implement calls to array constructors.
2010-03-31Reject array constructor calls in GLSL 1.10Ian Romanick1-0/+9
2010-03-31Use ast_type_specifier::glsl_type to get the type of a constructorIan Romanick1-2/+2
This is the first baby step towards getting array constructors working.
2010-03-29Allow single-component constructorsIan Romanick1-1/+1
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
2010-03-26Initial implementation of constructor handling codeIan Romanick1-0/+240
All of the scalar, vector, and matrix constructors *except* "from bool" constructors should be handled. Array and structure constructors are also not yet handled.
2010-03-26Add new abstract ir_rvalue class; rework accordingly.Kenneth Graunke1-2/+2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-23Begin processing constructorsIan Romanick1-8/+25
Right now, reject constructors for samplers because the are illegal.
2010-03-19Use glsl_symbol_table instead of using _mesa_symbol_table directlyIan Romanick1-3/+2
2010-03-15Factor guts of function matching code out to match_function_by_nameIan Romanick1-50/+56
This function will be used for matching some types of constructors as well.
2010-03-15Move ast_function_expression::hir to ast_function.cppIan Romanick1-0/+109