Ian Romanick
4230cfdb42
TODO: Add note about initializers for constants
15 years ago
Ian Romanick
ce03088406
Allow initializers for uniforms
15 years ago
Ian Romanick
c648a124b2
Don't link shaders by default
Add a command line option to trigger linking. This "fixes" all the
failing test cases. Oops.
15 years ago
Ian Romanick
832dfa58b2
linker: Initial bits of the linker
No linking is done yet, but some of the semantic checking is done.
15 years ago
Ian Romanick
705fb01b59
Use glsl_program instead of an open-coded vector of shaders
15 years ago
Ian Romanick
3f09c2508a
Add glsl_program that is similar to Mesa's gl_shader_program
15 years ago
Ian Romanick
f8fe53ca2e
Change glsl_program to glsl_shader
15 years ago
Ian Romanick
6fd9fb23de
Compile multiple shaders listed on the command line
15 years ago
Ian Romanick
8ce55dbd92
Extract compilation to a separate routine
Pull all of the code that actually compiles shaders into a separate
function. Use a glsl_program to track data about the compiled shader.
15 years ago
Ian Romanick
869b6f680f
Add glsl_program that is similar to Mesa's gl_program
This will be used as the header for individual compilation units.
15 years ago
Ian Romanick
298586fd6c
Add TODO list
Don't want to forget anything, no do we?
15 years ago
Ian Romanick
81e1747ac5
Printing LIR is optional
15 years ago
Ian Romanick
7babbdbd82
Printing the AST is optional
15 years ago
Ian Romanick
fc0ef6451c
Minor bits of code rearranging
15 years ago
Ian Romanick
2b36895f0c
Infer shader type from suffix on filename
15 years ago
Ian Romanick
54992c30b0
Remove ability to read "IR shaders" from stand-alone compiler
15 years ago
Ian Romanick
61d4aa041f
Move stand-alone compiler main routine to main.cpp
15 years ago
Ian Romanick
824b659d91
ir_constant: Eliminate 'void *' constructor
All of the places that had been using the (glsl_type *, void *)
constructor were actually passing an ir_constant_data for the
'void *'. The code can be greatly simplified by replacing this
constructor with a (glsl_type *, ir_constant_data *) constructor.
This should also help prevent one class of invalid uses of the old
constructor.
15 years ago
Ian Romanick
b74b43e4ba
Use statically typed ir_constant constructors wherever possible
15 years ago
Ian Romanick
4976e57448
ir_reader: Use 'union ir_constant_data' in read_constant
15 years ago
Ian Romanick
f8b88bea0f
ir_constant_visitor: Type of constant result is same as original expression
The type of the resulting constant must be the same as the type of the
original expression. The changes to the code require that the case
where an unhandled expression is received, and there really shouldn't
be any of these, must be an exit point.
15 years ago
Ian Romanick
083d75a942
ir_constant_visitor: Types of ir_binop_{equal,nequal} must match
The types must match exactly, so there is no reason to check the types here.
15 years ago
Ian Romanick
4daaab6040
ir_constant_visitor: Use 'union ir_constant_data' in expression handler
15 years ago
Ian Romanick
0bb70a30d5
ir_constant_visitor: Use 'union ir_constant_data' instead of open-coded version
15 years ago
Ian Romanick
be1d2bfdea
Matrix and vector constructors with a single constant scalar are constant
15 years ago
Ian Romanick
39d6dd3537
ir_constant_visitor: Handle bool-to-int and int-to-bool
15 years ago
Ian Romanick
7825d3d157
Treat ?: with all constant subexpressions as a constant expression
15 years ago
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.
15 years ago
Ian Romanick
c2ba619092
ir_constant_visitor: Handle constant swizzles
15 years ago
Ian Romanick
9b92af9ebc
ir_constant_visitor: Handle array access of constant vectors and matrices
15 years ago
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.
15 years ago
Ian Romanick
1a872b1af3
Do simple constant folding while processing function call parameters
15 years ago
Ian Romanick
253dedeb6c
ir_constant_visitor: Handle dereferences of constant records
15 years ago
Ian Romanick
b94c29a47b
ir_constant: Add get_record_field query
15 years ago
Ian Romanick
eeedd355cf
Add glsl_types::field_index to get the location of a record field
15 years ago
Ian Romanick
ab92d0e53e
Detect and process constant record constructors
15 years ago
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.
15 years ago
Ian Romanick
d4b33edbd0
ir_constant_visitor: Use clone to create a constant from a variable reference
15 years ago
Ian Romanick
710919fd7c
ir_constant: Support constant structures in clone
15 years ago
Ian Romanick
7f1ab834d7
ir_constant: Add storage for multiple constants for arrays and records
15 years ago
Ian Romanick
93073551f9
Add glsl_type::is_record query
15 years ago
Ian Romanick
7dc2b71a89
Add float/bool conversion to ir_constant_expression.cpp.
15 years ago
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.
15 years ago
Ian Romanick
9e08d019ce
Make constructors with all constant parameters generate in-line constants
15 years ago
Ian Romanick
756a3fac4f
Construct an ir_constant from a list of ir_constant values
15 years ago
Ian Romanick
7c40a32054
Add queries to determine if a node is a list sentinal
15 years ago
Ian Romanick
31881908eb
Add methods to ir_constant to get scalar components in a particular type
15 years ago
Ian Romanick
c9cb1032be
Derefence components of constants smarter
During generation of calls to constructors, derefernce constants by creating
new constants instead of creating dereferences.
15 years ago
Ian Romanick
989cfc432e
Construct an ir_constant from a scalar component of another ir_constant
15 years ago
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.
15 years ago