Ian Romanick
00e517616b
Add glsl_type::element_type and glsl_type::array_size queries
The former gets the type of elements in an array, and the later gets
the declared size, if any, of the array.
15 years ago
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.
15 years ago
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.
15 years ago
Ian Romanick
0bf3810165
glsl_type array constructor generate a real name for the type
15 years ago
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.
15 years ago
Ian Romanick
70348543ac
Add glsl_type::is_array and glsl_type::is_float queries
15 years ago
Ian Romanick
738c183cc9
Slightly change the representation of numeric types
For numeric types, vector_elements and matrix_columns must be at least
1. Previously matrix_columns was 0 for vectors, and both were 0 for
scalars. This change simplifies things in some places.
15 years ago
Ian Romanick
d811d47609
Add glsl_type::components to query total number of components in a type
15 years ago
Ian Romanick
cef3baecf6
Replace remaining use of is_error_type with glsl_type::is_error
15 years ago
Ian Romanick
a6d653dcbb
Replace remaining uses of is_numeric_base_type with glsl_type::is_numeric
15 years ago
Ian Romanick
40176e249f
Replace is_integer_base_type macro with glsl_type::is_integer method
15 years ago
Ian Romanick
0471e8b089
Make glsl_*_type glsl_type class static data
15 years ago
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.
15 years ago
Ian Romanick
1b4f04124a
Fix matrix dimensioning
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.
15 years ago
Ian Romanick
252127c379
Add queries to get the glsl_type of a row or column of a matrix
15 years ago
Ian Romanick
532edd9bc4
Remove unused _mesa_glsl_get_vector_type
This function has been completely replaced by glsl_type::get_instance.
15 years ago
Ian Romanick
3209c4e369
Add glsl_type::get_instance method
Gets the singleton corresponding to a particular scalar, vector, or
matrix type.
15 years ago
Ian Romanick
9ff8f3777e
Add class-private handles to matrix types in glsl_type
15 years ago
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.
15 years ago
Ian Romanick
7aeb6abda7
Add glsl_type::is_numeric and glsl_type::is_boolean queries
15 years ago
Ian Romanick
cb7d066967
Add query to determine whether a type is a sampler
15 years ago
Ian Romanick
8400bc4d35
Add is_error and is_void type queries
15 years ago
Ian Romanick
986b8f7982
Tell emacs that C++ .h files are C++
15 years ago
Ian Romanick
fce1150156
Convert is_glsl_type_matrix to glsl_type::is_matrix
15 years ago
Ian Romanick
a2dd22fb19
Convert is_glsl_type_vector to glsl_type::is_vector
15 years ago
Ian Romanick
cb36f8aaee
Convert is_glsl_type_scalar to glsl_type::is_scalar
15 years ago
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.
15 years ago
Ian Romanick
a87ac255cf
Initial commit. lol
15 years ago