Commit Graph

24 Commits

Author SHA1 Message Date
Eric Anholt 82ad90f8cf Fix the swizzling of vector constructors from scalars.
A refactor turned 'i' into '1', meaning everything writemasked into
the y component.
2010-04-23 16:12:44 -07:00
Kenneth Graunke 25851a8d87 Fix illegal (var_ref (array_ref ...)) in matrix constructors. 2010-04-22 00:25:55 -07:00
Kenneth Graunke 7bcd5bedcc Emit body for constructors in the right place.
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.
2010-04-21 15:37:10 -07:00
Kenneth Graunke 9fa99f3b6c Refactor IR function representation.
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-21 15:36:36 -07:00
Eric Anholt fbc7c0b8f2 Make function bodies rely on the parameter variable declarations.
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.
2010-04-07 17:23:23 -07:00
Eric Anholt 894ea972a4 Put function bodies under function signatures, instead of flat in the parent.
This will let us know the length of function bodies for the purpose of
inlining (among other uses).
2010-04-07 17:23:23 -07:00
Ian Romanick 0c82465395 Treat texture rectangles as an extension that is enabled be default 2010-04-07 17:13:44 -07:00
Ian Romanick 6a15d5b514 Use ir_function::add_signature to create link between function and signature
ir_function_signature now has a pointer back to the ir_function that owns it.
2010-03-31 16:37:10 -07:00
Ian Romanick 4ef183e51d Add glsl_type::generate_constructor_prototype
Generates a symbol table entry and the IR approximation of a prototype for a
type's constructor.  Currently only arrays are supported.
2010-03-31 16:30:56 -07:00
Ian Romanick 299ed08a68 Fix big dumbness in glsl_type::get_array_instance
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.
2010-03-31 16:13:38 -07:00
Ian Romanick 0bf3810165 glsl_type array constructor generate a real name for the type 2010-03-31 14:37:42 -07:00
Ian Romanick 548a1b5ab7 Implement array type handling
Since all glsl_type objects are flyweights, support is added to track all
known array types.  This accounts for most of the changes.
2010-03-30 16:58:19 -07:00
Eric Anholt ab372dab2a Reject main() declarations with a non-void return value.
Fixes main3.vert.
2010-03-29 12:48:45 -07:00
Ian Romanick 9f93d24050 Be sure to set ir_function_signature::definition for constructors 2010-03-26 17:28:52 -07:00
Ian Romanick 0471e8b089 Make glsl_*_type glsl_type class static data 2010-03-26 14:33:41 -07:00
Kenneth Graunke affc1413ac Move swizzles out of ir_dereference and into their own class.
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-26 14:00:59 -07:00
Kenneth Graunke fb9fb5f51d Add new abstract ir_rvalue class; rework accordingly.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 13:58:48 -07:00
Ian Romanick 720c88eab9 Add functions to generate constructors for built-in types.
Currently only vector and matrix types are supported.  Structure types will be
added later.
2010-03-25 16:58:45 -07:00
Ian Romanick 532edd9bc4 Remove unused _mesa_glsl_get_vector_type
This function has been completely replaced by glsl_type::get_instance.
2010-03-24 17:47:20 -07:00
Ian Romanick 3209c4e369 Add glsl_type::get_instance method
Gets the singleton corresponding to a particular scalar, vector, or
matrix type.
2010-03-24 17:11:30 -07:00
Ian Romanick bb7e00a1cd Add glsl_type::get_base_type query
Retreives the glsl_type that corresponds to the base type of a numeric scalar /
vector / matrix type.  So vec4 returns float, etc.
2010-03-23 17:31:39 -07:00
Ian Romanick 7563b50075 Add `void' type to table of available types
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.
2010-03-23 12:11:50 -07:00
Ian Romanick 8bde4cec6b Use glsl_symbol_table instead of using _mesa_symbol_table directly 2010-03-19 11:57:24 -07:00
Ian Romanick eccf0bf5f2 Make glsl_type a class
Among other benefits, this cleans up a the hackery invovled in
initializing the union field in builtin_types.h.
2010-03-09 15:49:31 -08:00
Renamed from glsl_types.c (Browse further)