Ian Romanick
7954922473
IR print visitor: Finish printing constants
il y a 15 ans
Ian Romanick
d14642739e
IR print visitor: Remove most of the newlines from the printed output
This makes it a lot easier to read... if you have a really wide display.
il y a 15 ans
Ian Romanick
d7388f389d
IR print visitor: print expressions
Not quite complete. The operator is not yet printed.
il y a 15 ans
Ian Romanick
8c70a62193
IR print visitor: print ir_dereference instructions
Also make a slight change to ir_variable. The ir_dereference tracks
the number of nested dereferences. If an ir_variable is visited and
the count is non-zero, just print the name of the variable.
il y a 15 ans
Ian Romanick
6e7c278e24
IR print visitor: Less newlines when printing ir_variables
il y a 15 ans
Eric Anholt
ece0a51160
Fix assignment operators: *=, /=, +=, -=.
Basically, replace everything different from operator_assign other
than the creation of the rhs value from the lvalue and rvalue with the
contents of operator_assign. Fixes a segfault in
CorrectSwizzle1.frag, and fixes parser10.frag.
il y a 15 ans
Ian Romanick
a4e92c4b26
Before generating HIR for user code, generate constructors for built-in types
il y a 15 ans
Ian Romanick
9546997736
Add dereference constructor for array element dereferences
This should have gone in before the previous commit.
il y a 15 ans
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.
il y a 15 ans
Eric Anholt
2f9ca7dce2
Fix up the operator printing for the logic or and beyond, check array bounds.
il y a 15 ans
Ian Romanick
acb36240e5
Merge branch 'anholt'
il y a 15 ans
Eric Anholt
b3f743ab0b
Set up fragment shader builtin variables.
il y a 15 ans
Eric Anholt
7c15bb2465
Make the standalone parser return an exit code so we can automate testing.
il y a 15 ans
Ian Romanick
68507eceea
More matrix compilation tests
il y a 15 ans
Ian Romanick
3d303eb59f
Merge branch 'kwg'
il y a 15 ans
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.
il y a 15 ans
Ian Romanick
c1bd3a1a61
Use glsl_type::row_type and glsl_type::column type in arithmetic_result_type
This substantially clarifies the code for matching matrix types. It
also eliminates some uses of glsl_type member data.
il y a 15 ans
Ian Romanick
80b5ed6e63
Replace several glsl_type field comparisons with a single pointer comparison
This simplifies the process of matching function parameter types.
More simplifications are probably possible here, but arrays and
structures need to be implemented first.
il y a 15 ans
Ian Romanick
252127c379
Add queries to get the glsl_type of a row or column of a matrix
il y a 15 ans
Kenneth Graunke
f25a5ad939
Widen num_components to handle vec4 correctly.
il y a 15 ans
Kenneth Graunke
904872372e
Typo fixes: de/re/ference.
il y a 15 ans
Ian Romanick
664da2510a
Replace several field comparisons with a single pointer comparison
The only way the specified type fields can match is if the types are the
same. Previous tests (and assertions) have filtered away all other possible
cases.
il y a 15 ans
Ian Romanick
532edd9bc4
Remove unused _mesa_glsl_get_vector_type
This function has been completely replaced by glsl_type::get_instance.
il y a 15 ans
Ian Romanick
c4e2627045
Use glsl_type::get_instance instead of _mesa_glsl_get_vector_type
il y a 15 ans
Ian Romanick
d2b6bc651a
Use glsl_type::get_instance instead of symbol table look-up
il y a 15 ans
Ian Romanick
e4fca97afd
Add some matrix math tests
il y a 15 ans
Ian Romanick
3209c4e369
Add glsl_type::get_instance method
Gets the singleton corresponding to a particular scalar, vector, or
matrix type.
il y a 15 ans
Ian Romanick
60b54d977a
Replace accesses to glsl_type data with query functions
In these particular cases, using the query functions makes it more obvious
what is happening.
il y a 15 ans
Ian Romanick
9ff8f3777e
Add class-private handles to matrix types in glsl_type
il y a 15 ans
Ian Romanick
4d184a1d02
Fix typo in swizzle processing loop
One of the accesses to str in the loop used str[0] instead of str[i].
Reported-by: Kenneth Graunke
il y a 15 ans
Ian Romanick
9e97ffb754
Trivial cleanups in generate_swizzle
Add 'const' and 'static const' in a couple of places.
il y a 15 ans
Ian Romanick
afbe26fd61
Use ir_dereference::set_swizzle
il y a 15 ans
Ian Romanick
2f4240fb02
Add method to set the swizzle of an ir_dereference
il y a 15 ans
Ian Romanick
44bb1a62f9
Allow duplicate symbols at the same scope that are in different name spaces
il y a 15 ans
Ian Romanick
d00b7958c0
Merge branch 'anholt'
il y a 15 ans
Ian Romanick
7d9bce3551
Add (negative) test for constructing samplers
il y a 15 ans
Ian Romanick
882dad7540
ir_function constructor now takes the function name as a parameter
il y a 15 ans
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.
il y a 15 ans
Ian Romanick
7aeb6abda7
Add glsl_type::is_numeric and glsl_type::is_boolean queries
il y a 15 ans
Ian Romanick
abef955764
Begin processing constructors
Right now, reject constructors for samplers because the are illegal.
il y a 15 ans
Ian Romanick
cb7d066967
Add query to determine whether a type is a sampler
il y a 15 ans
Ian Romanick
1e5cd2b05b
Add test for invalid assignment of function return value
il y a 15 ans
Ian Romanick
0bb1c3c153
Add *some* type checking for assignments
il y a 15 ans
Ian Romanick
71d0bbfcb2
Disallow passing NULL for state to _mesa_glsl_error
The two places that were still passing NULL had a state pointer to
pass. Not passing it in these places prevented termination of
compilation of erroneous programs.
il y a 15 ans
Ian Romanick
f3f111eac4
Fix typographical errors of "FINISHME"
il y a 15 ans
Eric Anholt
f41fc53728
Include other generated sources in BUILT_SOURCES.
Otherwise, having cleaned glsl_parser.h, we'd never regenerate it because
glsl_parser.cpp was already right where it needed to be.
il y a 15 ans
Eric Anholt
e5ba18083b
Use bash for the built file generation since builtin_types.sh requires it.
il y a 15 ans
Eric Anholt
6985a43832
Clean the built sources with make clean.
il y a 15 ans
Ian Romanick
cec65a6b76
Generate an error for variables declared with type void
il y a 15 ans
Ian Romanick
8400bc4d35
Add is_error and is_void type queries
il y a 15 ans