summaryrefslogtreecommitdiff
path: root/ir.cpp
AgeCommit message (Collapse)Author
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
2010-04-01Fix type handling in ir_dereference array dereference constructorIan Romanick
2010-03-26Set variables with the sampler base type to read only.Eric Anholt
Fixes increment3.frag.
2010-03-26Add constructors for immediate hir constants.Eric Anholt
This will make ast_to_hir for inc/dec easier.
2010-03-26Add glsl_type::components to query total number of components in a typeIan 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-26Replace "mode" type tag with virtual as_foo() downcasting functions.Kenneth Graunke
These should work well even in a non-flat IR hierarchy. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-25Add dereference constructor for array element dereferencesIan Romanick
This should have gone in before the previous commit.
2010-03-25Fix matrix dimensioningIan Romanick
Newb GL mistake: matrices in GL are column-major. This means that vector_elements is the number of rows. Making these changes causes matrix-08.glsl to pass.