Ian Romanick
57bb893a46
glsl_type: Add method to get number of slots used by a type
pirms 15 gadiem
Ian Romanick
eeedd355cf
Add glsl_types::field_index to get the location of a record field
pirms 15 gadiem
Ian Romanick
93073551f9
Add glsl_type::is_record query
pirms 15 gadiem
Kenneth Graunke
56d3f6ad78
Set the type of ir_texture properly; infer it from the sampler type.
pirms 15 gadiem
Ian Romanick
82baaf4283
glsl_type::generate_constructor_prototype now generates the function too
Also, change the name of the method to generate_constructor.
pirms 15 gadiem
Ian Romanick
8f755dcb67
Add glsl_type::field_type
Query the type of a structure field
pirms 15 gadiem
Ian Romanick
230ade93a6
Make private glsl_type singletons public
pirms 15 gadiem
Eric Anholt
ec9e73870c
Put static pointers to vec[234]_types along with the static float_type.
Otherwise you have to type a lot of get_instance.
pirms 15 gadiem
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.
pirms 15 gadiem
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.
pirms 15 gadiem
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.
pirms 15 gadiem
Ian Romanick
0bf3810165
glsl_type array constructor generate a real name for the type
pirms 15 gadiem
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.
pirms 15 gadiem
Ian Romanick
70348543ac
Add glsl_type::is_array and glsl_type::is_float queries
pirms 15 gadiem
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.
pirms 15 gadiem
Ian Romanick
d811d47609
Add glsl_type::components to query total number of components in a type
pirms 15 gadiem
Ian Romanick
cef3baecf6
Replace remaining use of is_error_type with glsl_type::is_error
pirms 15 gadiem
Ian Romanick
a6d653dcbb
Replace remaining uses of is_numeric_base_type with glsl_type::is_numeric
pirms 15 gadiem
Ian Romanick
40176e249f
Replace is_integer_base_type macro with glsl_type::is_integer method
pirms 15 gadiem
Ian Romanick
0471e8b089
Make glsl_*_type glsl_type class static data
pirms 15 gadiem
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.
pirms 15 gadiem
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.
pirms 15 gadiem
Ian Romanick
252127c379
Add queries to get the glsl_type of a row or column of a matrix
pirms 15 gadiem
Ian Romanick
532edd9bc4
Remove unused _mesa_glsl_get_vector_type
This function has been completely replaced by glsl_type::get_instance.
pirms 15 gadiem
Ian Romanick
3209c4e369
Add glsl_type::get_instance method
Gets the singleton corresponding to a particular scalar, vector, or
matrix type.
pirms 15 gadiem
Ian Romanick
9ff8f3777e
Add class-private handles to matrix types in glsl_type
pirms 15 gadiem
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.
pirms 15 gadiem
Ian Romanick
7aeb6abda7
Add glsl_type::is_numeric and glsl_type::is_boolean queries
pirms 15 gadiem
Ian Romanick
cb7d066967
Add query to determine whether a type is a sampler
pirms 15 gadiem
Ian Romanick
8400bc4d35
Add is_error and is_void type queries
pirms 15 gadiem
Ian Romanick
986b8f7982
Tell emacs that C++ .h files are C++
pirms 15 gadiem
Ian Romanick
fce1150156
Convert is_glsl_type_matrix to glsl_type::is_matrix
pirms 15 gadiem
Ian Romanick
a2dd22fb19
Convert is_glsl_type_vector to glsl_type::is_vector
pirms 15 gadiem
Ian Romanick
cb36f8aaee
Convert is_glsl_type_scalar to glsl_type::is_scalar
pirms 15 gadiem
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.
pirms 15 gadiem
Ian Romanick
a87ac255cf
Initial commit. lol
pirms 15 gadiem