Eric Anholt
c7da28b4be
Allow array dereferences to be considered as lvalues.
...
Fixes glsl-vs-arrays.vert and glsl-vs-mov-after-deref.vert.
Regresses parser3.frag which was failing for the wrong reason.
2010-04-02 11:22:41 -07:00
Eric Anholt
160d092507
Simplify ir_constant_expression.cpp by factoring operand computation out.
2010-04-02 11:22:41 -07:00
Ian Romanick
b8a21cc6df
Track max accessed array element, reject additional out-of-bounds accesses
...
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-01 18:35:08 -07:00
Ian Romanick
63af4b0e99
Fix type handling in ir_dereference array dereference constructor
2010-04-01 18:02:48 -07:00
Eric Anholt
72fc47f0b0
Set variables with the sampler base type to read only.
...
Fixes increment3.frag.
2010-03-26 17:51:41 -07:00
Eric Anholt
3c36b2df7c
Add constructors for immediate hir constants.
...
This will make ast_to_hir for inc/dec easier.
2010-03-26 17:51:41 -07:00
Ian Romanick
d811d47609
Add glsl_type::components to query total number of components in a type
2010-03-26 14:43:11 -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
Kenneth Graunke
44e1dfa2df
Replace "mode" type tag with virtual as_foo() downcasting functions.
...
These should work well even in a non-flat IR hierarchy.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com >
2010-03-26 12:50:40 -07:00
Ian Romanick
9546997736
Add dereference constructor for array element dereferences
...
This should have gone in before the previous commit.
2010-03-25 17:01:15 -07:00
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.
2010-03-25 13:19:13 -07:00
Ian Romanick
2f4240fb02
Add method to set the swizzle of an ir_dereference
2010-03-24 15:12:21 -07:00
Ian Romanick
882dad7540
ir_function constructor now takes the function name as a parameter
2010-03-23 17:42:04 -07:00
Ian Romanick
e39cc69fa3
Set, and require, a return type for function signatures
2010-03-23 12:19:13 -07:00
Ian Romanick
ed45ec6a51
Add ir_call call to represent function calls.
2010-03-11 14:35:37 -08:00
Ian Romanick
d27ec2461b
Fix broken constructor of ir_instruction base class
...
Make the constructor inline-able, and don't try to initialize it as a
simple_node. It hasn't been derived from simple_node in a long time.
2010-03-11 14:23:41 -08:00
Ian Romanick
654c057257
ir_variable: Initialize all attribute bits to reasonable defaults
...
This prevents variables from randomly having their 'invariant' or
'read_only' bits set, for example.
2010-03-10 00:21:27 -08:00
Ian Romanick
0044e7edce
Conver IR structures to use exec_list instead of simple_node
2010-03-08 23:44:54 -08:00
Ian Romanick
d5f4f09e76
Rename .cc files to .cpp
2010-02-22 18:43:08 -08:00