summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Change grammar rules for selection statements to match the spec.Kenneth Graunke2010-09-073-950/+913
| | | | | | Fixes piglit test case loop-06.vert. Unfortunately, causes 1 shift/reduce conflict.
* glsl2: check for _NumLinkedShaders being 0Török Edvin2010-09-071-1/+1
| | | | | | | Otherwise spring 0.82+.4.0 crashes when starting a game because prog->_LinkedShaders[0] is NULL. This also fixes piglit test cases glsl-link-empty-prog-0[12].
* glsl: Add new files to sconscript.José Fonseca2010-09-051-0/+3
|
* ir_reader: Only validate IR when a global 'debug' flag is set.Kenneth Graunke2010-09-051-1/+4
| | | | | | | | | This extra validation is very useful when working on the built-ins, but in general overkill - the results should stay the same unless the built-ins or ir_validate have changed. Also, validating all the built-in functions in every test case makes piglit run unacceptably slow.
* ir_reader: Run ir_validate on the generated IR.Kenneth Graunke2010-09-041-0/+2
| | | | It's just too easy to get something wrong in hand-written IR.
* ir_reader: Emit global variables at the top of the instruction list.Kenneth Graunke2010-09-041-2/+11
| | | | | | | | Since functions are emitted when scanning for prototypes, functions always come first, even if the original IR listed the variable declarations first. Fixes an ir_validate error (to be turned on in the next commit).
* ir_reader: Drop support for reading the old assignment format.Kenneth Graunke2010-09-041-6/+4
|
* glsl: Regenerate autogenerated file builtin_function.cpp.Kenneth Graunke2010-09-041-402/+390
|
* glsl/builtins: Convert assignments to new format (with write mask).Kenneth Graunke2010-09-0415-398/+389
|
* ir_reader: Read the new assignment format (with write mask).Kenneth Graunke2010-09-041-6/+46
| | | | | This preserves the ability to read the old format, for momentary compatibility with all the existing IR implementations of built-ins.
* ir_reader: Track the current function and report it in error messages.Kenneth Graunke2010-09-041-0/+6
|
* glsl/builtins: Actually print the info log if reading a builtin failed.Kenneth Graunke2010-09-041-0/+1
|
* exec_list: replace class with structBrian Paul2010-09-031-1/+1
| | | | To match the definition below.
* glsl2: Use as_constant some places instead of constant_expression_valueIan Romanick2010-09-032-3/+3
| | | | | | | | | | | The places where constant_expression_value are still used in loop analysis are places where a new expression tree is created and constant folding won't have happened. This is used, for example, when we try to determine the maximal loop iteration count. Based on review comments by Eric. "...rely on constant folding to have done its job, instead of going all through the subtree again when it wasn't a constant."
* glsl2: Allow copy / constant propagation into array indicesIan Romanick2010-09-032-32/+12
|
* glsl2: Add module to perform simple loop unrollingIan Romanick2010-09-037-3/+123
|
* glsl2: Track the number of ir_loop_jump instructions that are in a loopIan Romanick2010-09-033-0/+27
|
* ir_expression: Add static operator_string methodIan Romanick2010-09-032-3/+13
| | | | | I've used this in quite a few debug commits that never reached an up-stream tree.
* exec_node: Add insert_before that inserts an entire listIan Romanick2010-09-031-0/+23
|
* glsl2: Eliminate zero-iteration loopsIan Romanick2010-09-031-1/+7
|
* glsl2: Perform initial bits of loop analysis during compilationIan Romanick2010-09-032-0/+10
|
* glsl2: Add module to suss out loop control variables from loop analysis dataIan Romanick2010-09-034-1/+305
| | | | This is the next step on the road to loop unrolling
* glsl2: Add module to analyze variables used in loopsIan Romanick2010-09-034-1/+672
| | | | This is the first step eventually leading to loop unrolling.
* ir_validate: Validate loop control fields in ir_loopIan Romanick2010-09-031-0/+35
|
* glsl2: Add cmp field to ir_loopIan Romanick2010-09-033-6/+34
| | | | | This reprents the type of comparison between the loop induction variable and the loop termination value.
* glsl2: Set a flag when visiting the assignee of an assignmentIan Romanick2010-09-034-0/+24
|
* exec_list: Add pop_headIan Romanick2010-09-031-0/+17
|
* ir_print_visitor: Print empty else blocks more compactlyIan Romanick2010-09-031-9/+13
|
* glsl2: Update TODO fileIan Romanick2010-09-021-19/+7
|
* glsl: Apply implicit conversions to structure constructor parameters.Kenneth Graunke2010-09-012-3/+10
| | | | | | | The code for handling implicit conversions should probably get refactored, but for now, this is easy. Fixes piglit test constructor-26.vert.
* glsl: Convert constant record constructor parameters to ir_constants.Kenneth Graunke2010-09-011-1/+3
| | | | I'm not sure if this is strictly necessary, but it seems wise.
* glsl: Reject structure constructors that have too many arguments.Kenneth Graunke2010-09-011-0/+6
| | | | Fixes piglit test constructor-27.vert.
* glsl2: Remove unnecessary glsl_symbol_table::get_function parameter ↵Ian Romanick2010-09-013-9/+4
| | | | | | | | return_constructors Now that constructors are not generated as functions or stored in the symbol table, there is no need to flag whether or not constructors should be returned.
* glsl2: Remove unused method glsl_type::generate_constructorIan Romanick2010-09-012-59/+0
|
* glsl2: Remove unused 'constructor' parameter from glsl_symbol_table::add_typeIan Romanick2010-09-012-6/+4
|
* glsl2: Don't generate constructor functions for structuresIan Romanick2010-09-012-3/+2
|
* glsl2: Emit structure constructors inlineIan Romanick2010-09-011-37/+70
| | | | Fixes piglit test cases glsl-[fv]s-all-0[12].
* glsl: Fix write mask in matrix-from-matrix constructors.Kenneth Graunke2010-09-011-3/+5
| | | | | | | | | | | If the matrix being constructed was larger than the source matrix, it would overwrite the lower-right part of the matrix with the wrong values, rather than leaving it as the identity matrix. For example, constructing a mat4 from a mat2 should only use a writemask of "xy" when copying from the source, but was using "xyzw". Fixes the code generated by piglit test constructor-23.vert.
* glsl: Add proper handling for constant matrix-from-matrix constructors.Kenneth Graunke2010-09-011-0/+25
| | | | | Fixes piglit test case constructor-21.vert and changes constructor-22.vert to give the correct output.
* glsl: Move generate_constructor_(matrix|vector) to ir_constant ctor.Kenneth Graunke2010-09-012-99/+36
|
* ast_function: Fix check for "too few components".Kenneth Graunke2010-09-011-1/+2
| | | | | | | | | This was triggering even for matrix-from-matrix constructors. It is perfectly legal to construct a mat3 from a mat2 - the rest will be filled in by the identity matrix. Changes piglit test constructor-23.vert from FAIL to PASS, but the generated code is incorrect.
* ast_function: Remove bogus cases from generate_constructor_matrix.Kenneth Graunke2010-09-011-29/+8
| | | | There are no integer matrix types, so switching on them is silly.
* glsl: Add forgotten implementations of equal/notEqual on bvecs.Kenneth Graunke2010-09-013-0/+120
|
* glsl2: Perform algebraic simplifications on logical binary operatorsIan Romanick2010-09-011-0/+52
| | | | | Reduces glsl-vs-all-01 from 42 Mesa IR instructions (including the END) to 17.
* glsl2: Allow ir_constant::zero to create boolean constantsIan Romanick2010-09-011-1/+1
|
* glsl2: Disallow function declarations within function definitions in GLSL 1.20Ian Romanick2010-09-011-1/+36
| | | | | | | The GLSL 1.20 spec specifically disallows this, but it was allowed in GLSL 1.10. Fixes piglit test cases local-function-0[13].frag and bugzilla #29921.
* glsl2: fix bug in atan(y, x) functionBrian Paul2010-08-312-13/+9
| | | | When x==0, the result was wrong. Fixes piglit glsl-fs-atan-1.shader_test
* glsl2: Write vector constructor constants in a single assignmentIan Romanick2010-08-311-11/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make two passes over the constructor parameters. Write all of the constants in a single write, then write the non-constants one at a time. This causes the fragment shader varying float g; void main() { gl_FragColor = vec4(0.0, g, 0.0, 1.0); } to generate (function main (signature void (parameters ) ( (declare (temporary ) vec4 vec_ctor@0x8580058) (assign (constant bool (1)) (xzw) (var_ref vec_ctor@0x8580058) (constant vec4 (0.000000 0.000000 0.000000 1.000000)) ) (assign (constant bool (1)) (y) (var_ref vec_ctor@0x8580058) (swiz xxxx (var_ref g@0x8580218) )) (assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x84d32a0) (var_ref vec_ctor@0x8580058) ) )) ) instead of (function main (signature void (parameters ) ( (declare (temporary ) vec4 vec_ctor@0x8580058) (assign (constant bool (1)) (x) (var_ref vec_ctor@0x8580058) (constant vec4 (0.000000 0.000000 0.000000 1.000000)) ) (assign (constant bool (1)) (y) (var_ref vec_ctor@0x8580058) (swiz xxxx (var_ref g@0x8580218) )) (assign (constant bool (1)) (z) (var_ref vec_ctor@0x8580058) (constant vec4 (0.000000 0.000000 0.000000 1.000000)) ) (assign (constant bool (1)) (w) (var_ref vec_ctor@0x8580058) (constant vec4 (0.000000 0.000000 0.000000 1.000000)) ) (assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x84d32a0) (var_ref vec_ctor@0x8580058) ) )) ) A similar optimization could be done for matrix constructors, but it is a little more complicate there.
* ast_to_hir: Add support for bit-wise operators (but not shifts).Kenneth Graunke2010-08-311-2/+53
| | | | | | | Previously, using bit-wise operators in some larger expression would crash on a NULL pointer dereference. This code at least doesn't crash. Fixes piglit test bitwise-01.frag.
* linker: Require an exact matching signature when looking for prototypes.Kenneth Graunke2010-08-301-1/+1
| | | | | | | Fixes piglit test glsl-override-builtin. The linker incorrectly found the prototype for the float signature, rather than adding a new prototype with the int return type. This caused ir_calls with type int to have their callees set to the float signature, triggering an assert.