summaryrefslogtreecommitdiff
path: root/ir.cpp
AgeCommit message (Collapse)Author
2010-06-24Merge remote branch 'cworth/master'Eric Anholt
Conflicts: ast_to_hir.cpp ir.cpp This brings in the talloc-based memory management work, so that the compiler (almost) no longer leaks memory.
2010-06-24Move ir_constant cloning alongside the other cloning functions.Eric Anholt
2010-06-23Close memory leak in ir_call::get_error_instruction.Carl Worth
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 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-23ir_variable: Add some missing initialization to the constructor.Carl Worth
Thanks to valgrind for noticing this problem.
2010-06-23Add a virtual clone() method to ir_instruction.Eric Anholt
This will be used by function inlining, the linker, and avoiding double usage of the LHS deref chains in ++, *=, and similar operations.
2010-06-23ir_variable: Add query to get number of slots used by a variableIan Romanick
2010-06-23ir_variable: Track the location of uniforms, varings, attributes, etc.Ian Romanick
2010-06-23ir_variable: Add method to get string representing interpolation qualifierIan Romanick
2010-06-23ir_constant: Add method to determine if two constants have the same valueIan Romanick
2010-06-11ir_constant: Eliminate 'void *' constructorIan Romanick
All of the places that had been using the (glsl_type *, void *) constructor were actually passing an ir_constant_data for the 'void *'. The code can be greatly simplified by replacing this constructor with a (glsl_type *, ir_constant_data *) constructor. This should also help prevent one class of invalid uses of the old constructor.
2010-06-11ir_constant: Add get_record_field queryIan Romanick
2010-06-11ir_constant: Support constant structures in cloneIan Romanick
2010-06-11ir_constant: Add storage for multiple constants for arrays and recordsIan Romanick
2010-06-11Construct an ir_constant from a list of ir_constant valuesIan Romanick
2010-06-11Add methods to ir_constant to get scalar components in a particular typeIan Romanick
2010-06-11Construct an ir_constant from a scalar component of another ir_constantIan Romanick
2010-06-09Implement dFdx, dFdy, and fwidth via new expression opcodes.Kenneth Graunke
2010-06-09Set the type of ir_texture properly; infer it from the sampler type.Kenneth Graunke
2010-06-09Add mappings between ir_texture_opcode and strings.Kenneth Graunke
2010-06-04Check variable mode when comparing qualifier lists.Kenneth Graunke
Fixes function-05.vert.
2010-05-26ir_dereference::mode is no longer used, kill with fireIan Romanick
2010-05-26Refactor ir_dereference data fields to subclassesIan Romanick
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-05-14Add ir_rvalue::variable_referencedIan Romanick
2010-05-14Implement "sin" and "cos" builtins via new expression operators.Kenneth Graunke
2010-05-14Implement "sign" builtin via a new expression operator.Kenneth Graunke
2010-05-10Remove unnecessary include of simple_list.hIan Romanick
2010-05-03ir_to_mesa.cpp: Fix missing types on some ir_swizzles.Eric Anholt
Debugging this took forever as I only looked at constructors in ir.cpp to find who wasn't setting up ->type. I dislike hiding code (as opposed to prototypes and definitions) in C++ header files, but in this case I have only myself to blame.
2010-04-28Implement structures and arrays in ir_dereference::is_lvalueIan Romanick
2010-04-28Add ir_dereference constructor for structure field dereferencesIan Romanick
2010-04-28Use "neg" when printing/reading unary negation rather than "-".Kenneth Graunke
"-" is now only used for binary subtraction.
2010-04-28Move array of operator strings out of ir_print_visitor.cpp.Kenneth Graunke
Also implement a reverse-lookup function for use in the IR reader.
2010-04-28Factor out parameter list replacement for later reuse.Kenneth Graunke
2010-04-28Factor out qualifier checking code for later reuse.Kenneth Graunke
2010-04-28Refactor ir_expression::get_num_operands.Kenneth Graunke
A new static version takes an ir_expression_operation enum, and the original non-static version now uses it. This will make it easier to read operations (where the ir_expression doesn't yet exist).
2010-04-21Remove ir_label since it is no longer used.Kenneth Graunke
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-07Remove extraneous base-class constructor callsIan Romanick
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-06Make constant folding descend into if statements.Eric Anholt
2010-04-06Handle constant expressions using derefs of const values.Eric Anholt
Fixes CorrectParse1.frag and makes for a ton of folding in CorrectParse2.frag.
2010-04-05Set correct type for ir_dereference of a matrix or a vectorIan Romanick
2010-04-02Track whether whole-arrays are assignableIan Romanick
In GLSL 1.10 this was not allowed, but in GLSL 1.20 and later it is. This causes the following tests to pass: glslparsertest/glsl2/array-09.vert glslparsertest/glsl2/array-13.vert
2010-04-02Whole structures are assignableIan Romanick
Whole arrays are assignable in GLSL 1.20 and later, but it's not clear how to handle that within the IR because the IR is supposed to be shading language version agnostic.
2010-04-02Add bool/int conversion as IR operations.Eric Anholt
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 Anholt
2010-04-02Allow array dereferences to be considered as lvalues.Eric Anholt
Fixes glsl-vs-arrays.vert and glsl-vs-mov-after-deref.vert. Regresses parser3.frag which was failing for the wrong reason.
2010-04-02Simplify ir_constant_expression.cpp by factoring operand computation out.Eric Anholt
2010-04-01Track max accessed array element, reject additional out-of-bounds accessesIan Romanick
For unsized arrays, we can't flag out-of-bounds accesses until the array is redeclared with a size. Track the maximum accessed element and generate an error if the declaration specifies a size that would cause that access to be out-of-bounds. This causes the following tests to pass: glslparsertest/shaders/array10.frag