Ian Romanick
39d6dd3537
ir_constant_visitor: Handle bool-to-int and int-to-bool
2010-06-11 15:43:59 -07:00
Ian Romanick
7825d3d157
Treat ?: with all constant subexpressions as a constant expression
2010-06-11 15:43:59 -07:00
Ian Romanick
0ad76c6767
Rearrange code in HIR conversion of ?: operator
...
There are no functional changes. Code is just moved arround. This
prepares for the next set of changes that do change the functionality.
2010-06-11 15:43:59 -07:00
Ian Romanick
c2ba619092
ir_constant_visitor: Handle constant swizzles
2010-06-11 15:43:59 -07:00
Ian Romanick
9b92af9ebc
ir_constant_visitor: Handle array access of constant vectors and matrices
2010-06-11 15:43:56 -07:00
Ian Romanick
2cf0969de5
Remove redundant type checks for constant constructors
...
All of the cases (e.g., arrays and structures) that were being
filtered by these tests were already filtered by the earlier
is_numeric and is_boolean tests.
2010-06-11 15:37:34 -07:00
Ian Romanick
1a872b1af3
Do simple constant folding while processing function call parameters
2010-06-11 15:37:34 -07:00
Ian Romanick
253dedeb6c
ir_constant_visitor: Handle dereferences of constant records
2010-06-11 15:37:27 -07:00
Ian Romanick
b94c29a47b
ir_constant: Add get_record_field query
2010-06-11 15:36:05 -07:00
Ian Romanick
eeedd355cf
Add glsl_types::field_index to get the location of a record field
2010-06-11 13:51:42 -07:00
Ian Romanick
ab92d0e53e
Detect and process constant record constructors
2010-06-11 13:51:42 -07:00
Ian Romanick
c077131c0f
Move parameter processing out of match_function_by_name
...
Eventually code that processes constant structure constructors will
need to use the processed list of parameters.
2010-06-11 13:51:42 -07:00
Ian Romanick
d4b33edbd0
ir_constant_visitor: Use clone to create a constant from a variable reference
2010-06-11 13:51:42 -07:00
Ian Romanick
710919fd7c
ir_constant: Support constant structures in clone
2010-06-11 13:51:42 -07:00
Ian Romanick
7f1ab834d7
ir_constant: Add storage for multiple constants for arrays and records
2010-06-11 13:51:42 -07:00
Ian Romanick
93073551f9
Add glsl_type::is_record query
2010-06-11 13:51:42 -07:00
Ian Romanick
7dc2b71a89
Add float/bool conversion to ir_constant_expression.cpp.
2010-06-11 13:51:42 -07:00
Ian Romanick
00eb466e38
Constant-fold constructor parameters after type conversion
...
This causes the following tests to pass:
glslparsertest/shaders/CorrectMatComma2.frag
One of the incorrect errors in glslparsertest/shaders/CorrectComma.frag
is also eliminated.
2010-06-11 13:51:42 -07:00
Ian Romanick
9e08d019ce
Make constructors with all constant parameters generate in-line constants
2010-06-11 13:51:09 -07:00
Ian Romanick
756a3fac4f
Construct an ir_constant from a list of ir_constant values
2010-06-11 13:51:09 -07:00
Ian Romanick
7c40a32054
Add queries to determine if a node is a list sentinal
2010-06-11 13:51:09 -07:00
Ian Romanick
31881908eb
Add methods to ir_constant to get scalar components in a particular type
2010-06-11 13:51:09 -07:00
Ian Romanick
c9cb1032be
Derefence components of constants smarter
...
During generation of calls to constructors, derefernce constants by creating
new constants instead of creating dereferences.
2010-06-11 13:51:09 -07:00
Ian Romanick
989cfc432e
Construct an ir_constant from a scalar component of another ir_constant
2010-06-11 13:51:09 -07:00
Ian Romanick
565185cd8f
Use ir_unop_b2i when converting a bool-to-int and add a missing break
...
The previous code just had dumb cut-and-paste errors.
2010-06-11 13:49:00 -07:00
Kenneth Graunke
332920a940
Remove linux_list in favor of exec_list.
2010-06-09 17:05:14 -07:00
Kenneth Graunke
75393ee16b
Add forgotten autogenerated EXT_texture_array_fs folder.
2010-06-09 16:46:09 -07:00
Kenneth Graunke
af05703826
Implement 1.30 int/uint variants of min/max/clamp.
2010-06-09 16:14:45 -07:00
Kenneth Graunke
c3bf0cbefc
texture_builtins.py: The unsigned integer type is "uint", not "unsigned"
...
This doesn't actually affect anything yet, but is good to fix anyway.
2010-06-09 16:11:36 -07:00
Kenneth Graunke
c9aabc866f
Implement 1.30 hyperbolic trig builtins (sinh, cosh, tanh).
2010-06-09 16:08:36 -07:00
Kenneth Graunke
1d0e07c420
Implement 1.20 'transpose' builtin.
2010-06-09 15:56:46 -07:00
Kenneth Graunke
43ff6fc4ae
Implement 1.20 'outerProduct' builtin.
2010-06-09 15:47:34 -07:00
Kenneth Graunke
0c8ffadc8c
Implement matrixCompMult builtin - the last of the 110 builtins.
2010-06-09 15:35:54 -07:00
Kenneth Graunke
d6a32d4b54
ir_constant_visitor: Add support for dFdx and dFdy operations.
...
If the argument is a constant expression...it's not changing per pixel,
so the result is simply 0.
2010-06-09 15:23:40 -07:00
Kenneth Graunke
b843c7a20c
Implement dFdx, dFdy, and fwidth via new expression opcodes.
2010-06-09 14:44:39 -07:00
Kenneth Graunke
cbd881da3f
Implement 'refract' builtin.
2010-06-09 14:44:39 -07:00
Kenneth Graunke
3ffedf1249
Fix some typing issues in asin.
...
CorrectFunction.vert now passes.
2010-06-09 14:15:04 -07:00
Kenneth Graunke
c476ba8fe2
Add a completely bogus implementation of the noise[1234] builtins.
...
idr suggested this. Eventually we will need a real one.
2010-06-09 14:07:35 -07:00
Kenneth Graunke
855fcb22c1
Implement 'acos' builtin.
...
This is tacked on to the end of the 'asin' file because acos calls asin,
whech means asin needs to be defined first. Alphabetical order fail.
2010-06-09 13:52:32 -07:00
Kenneth Graunke
539f29323f
Implement 'faceforward' builtin.
2010-06-09 13:27:16 -07:00
Kenneth Graunke
29b22287fe
Implement 'distance' builtin.
2010-06-09 13:17:00 -07:00
Kenneth Graunke
cdf1726ffd
Add remaining signatures for 'clamp' builtin.
2010-06-09 13:10:00 -07:00
Kenneth Graunke
76796ed66f
Add remaining signatures for 'max' builtin.
2010-06-09 13:05:40 -07:00
Kenneth Graunke
47d44c877e
Add remaining signatures for 'min' builtin.
2010-06-09 13:04:16 -07:00
Kenneth Graunke
2438f64e63
Add remaining signatures for 'mod' builtin.
2010-06-09 13:04:03 -07:00
Kenneth Graunke
b97efa5db5
ir_function_cloning_visitor: Add support for ir_texture.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
8331d48948
Don't call _mesa_glsl_initialize_types for every builtin function.
...
This was clearly wrong; types are now only initialized once.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
57503a22d7
Only initialize types after #extension directives have been processed.
...
Since _mesa_glsl_initialize_types add types for various extensions, we
can't call it until after processing "#extension foo : disable" lines.
Fixes tex_rect_02.frag.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
4b0029a97d
Commit output of texture_builtins.py and refresh builtin_function.cpp.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
5e65c1ccae
texture_builtins.py: Support the EXT_texture_array extension.
2010-06-09 11:14:58 -07:00