summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl2: Return progress from ir_vec_index_to_swizzle.Eric Anholt2010-08-041-1/+1
|
* glsl2: Generate masked assignments in some expanded matrix operationsIan Romanick2010-08-041-5/+10
|
* glsl2: Generate masked assignments in vector and matrix constructorsIan Romanick2010-08-041-36/+46
| | | | | | | Previously the in-line matrix and vector constructors would generate swizzles in the LHS. The code is actually more clear if it just generates the masked assignments instead of relying on the ir_assignment constructor to convert the swizzles to write masks.
* glsl2: Additional validation of write masksIan Romanick2010-08-041-0/+32
|
* glsl2: Add ir_assignment::write_mask and associated methodsIan Romanick2010-08-049-10/+174
| | | | | | | | | | | | | | | | | | | | | | | Replace swizzles on the LHS with additional swizzles on the RHS and a write mask in the assignment instruction. As part of this add ir_assignment::set_lhs. Ideally we'd make ir_assignment::lhs private to prevent erroneous writes, but that would require a lot of code butchery at this point. Add ir_assignment constructor that takes an explicit write mask. This is required for ir_assignment::clone, but it can also be used in other places. Without this, ir_assignment clones lose their write masks, and incorrect IR is generated in optimization passes. Add ir_assignment::whole_variable_written method. This method gets the variable on the LHS if the whole variable is written or NULL otherwise. This is different from ir->lhs->whole_variable_referenced() because the latter has no knowledge of the write mask stored in the ir_assignment. Gut all code from ir_to_mesa that handled swizzles on the LHS of assignments. There is probably some other refactoring that could be done here, but that can be left for another day.
* glsl2: Don't try to construct an ir_assignment with an invalid LHSIan Romanick2010-08-041-3/+2
|
* glsl2: Constant fold the children of many more ir_instruction types.Eric Anholt2010-08-041-7/+32
|
* glsl2: Return a real progress value from constant folding.Eric Anholt2010-08-041-3/+6
|
* glsl2: Refactor constant folding of rvalues to a function.Eric Anholt2010-08-041-26/+21
|
* glcpp: Refresh autogenerated lexer and parser.Kenneth Graunke2010-08-043-155/+148
|
* glcpp: Remove xtalloc wrappers in favor of plain talloc.Kenneth Graunke2010-08-046-153/+28
| | | | | | Calling exit() on a memory failure probably made sense for the standalone preprocessor, but doesn't seem too appealing as part of the GL library. Also, we don't use it in the main compiler.
* glsl2: Remove uses of deprecated TALLOC_CTX type.Kenneth Graunke2010-08-043-25/+25
|
* glsl2: add gl_LightModel built-in uniform.Aras Pranckevicius2010-08-041-0/+1
|
* glsl2: Don't try to assign locations for samplers during linking.Eric Anholt2010-08-041-0/+3
| | | | | | Mesa will do the mapping at _mesa_add_sampler() time. Fixes assertion failures in debug builds, which might have caught real problems with multiple samplers linked in a row.
* glsl2: Skip talloc_parent in constant_expression of non-constant arrays.Eric Anholt2010-08-041-1/+1
|
* glsl2: Make the clone() method take a talloc context.Eric Anholt2010-08-049-131/+130
| | | | | | | In most cases, we needed to be reparenting the cloned IR to a different context (for example, to the linked shader instead of the unlinked shader), or optimization before the reparent would cause memory usage of the original object to grow and grow.
* glsl2: Set ir_discard::ir_type when cloning itAras Pranckevicius2010-08-041-0/+1
| | | | Fixes unset ir_type after inlining.
* glsl2: Fix ir_validate validating null variable names.Eric Anholt2010-08-031-1/+2
| | | | | | | | | An unnamed variable in a prototype will have a NULL ->name, so don't worry about storage then. Fixes: CorrectFunction1.vert CorrectParse1.frag
* glsl2: No need to strdup the name passed in to ir_variable constructor.Eric Anholt2010-08-031-13/+5
| | | | | ir_variable always strdups the incoming name so that it matches the lifetime of the ir_variable.
* glsl2: Fix typo in clamp() constant builtin using uint instead of int.Eric Anholt2010-08-021-1/+1
| | | | | I take back the bad things I've said about the signed/unsigned comparison warning now.
* glsl2: Don't consider uniform initializers as constant expressions.Eric Anholt2010-08-021-0/+6
| | | | | We were happily optimizing away the body of glsl-uniform-initializer-* to never use the uniforms.
* glsl2: Use talloc_zero_size instead of talloc_size to allocate ast_node objects.Carl Worth2010-08-021-1/+1
| | | | | | This is a zero-ing function, (like calloc), to avoid bugs due to accessing uninitialized values. Thanks to valgrind for noticing the use of uninitialized values.
* glsl_type: Use string key for array type hashIan Romanick2010-08-022-40/+12
|
* glsl2: Clean-up two 'unused variable' warningsIan Romanick2010-08-022-0/+5
|
* glsl2: Make glsl_types::ctx private againIan Romanick2010-08-022-3/+5
|
* glsl2: Fix expression type in builtin tan().Eric Anholt2010-08-022-6/+6
| | | | Fixes glsl-fs-tan-1.
* glsl2: Add validation that talloc ownership of ir_* names is right.Eric Anholt2010-08-021-1/+3
|
* glsl2: Fix validation for ir_unop_not.Eric Anholt2010-08-021-2/+2
| | | | We use vector ir_unop_not to implement builtin not(), and that seems fine.
* glsl2: Add support for floating constants like "1f".Eric Anholt2010-08-022-426/+438
| | | | Fixes glsl-floating-constant-120.
* glsl2: Initialize the ARB_fcc fields of ir_variable.Eric Anholt2010-08-021-0/+2
| | | | Fixes intermittent failure in glsl-arb-fragment-coord-conventions.
* glsl2: Also initialize the identifier field of parameter_declarator.Eric Anholt2010-08-021-0/+1
| | | | | | The non-named parameter grammar understandably doesn't set the identifier field. Fixes intermittent failures about void main(void) {} having a named void parameter.
* glsl2: Fix spelling of "precision" in error output.Eric Anholt2010-08-022-6/+6
|
* glsl2: Don't add mesa/program/ as an include dir. Let includes say program/.Eric Anholt2010-08-021-1/+0
|
* glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius2010-08-029-9/+9
|
* glsl2: initialize is_array and array_size of ast_parameter_declaratorAras Pranckevicius2010-08-021-0/+6
| | | | The non-array path of glsl_parser.ypp wasn't setting is_array to false.
* glsl2: Make non-square matrix keywords not keywords pre-120.Eric Anholt2010-08-012-313/+207
| | | | Fixes glsl-mat-110.
* glcpp: Add a testcase for the failure in compiling xonotic's shader.Eric Anholt2010-08-012-0/+9
| | | | gcc and mesa master agree that this is OK.
* glsl2: Do algebraic optimizations after linking as well.Eric Anholt2010-07-311-0/+1
| | | | | Linking brings in inlining of builtins, so we weren't catching the (rcp(/sqrt(x)) -> rsq(x)) without it.
* glsl2: Add new tree grafting optimization pass.Eric Anholt2010-07-315-0/+360
|
* glsl2: Factor out the variable refcounting part of ir_dead_code.cpp.Eric Anholt2010-07-314-112/+190
|
* glsl2: Fix stack smash when ternary selection is used.Aras Pranckevicius2010-07-311-1/+1
|
* glsl2: Fix the implementation of atan(y, x).Eric Anholt2010-07-302-166/+166
| | | | | | | | | | | | | | | | So many problems here. One is that we can't do the quadrant handling for all the channels at the same time, so we call the float(y, x) version multiple times. I'd also left out the x == 0 handling. Also, the quadrant handling was broken for y == 0, so there was a funny discontinuity on the +x side if you plugged in obvious values to test. I generated the atan(float y, float x) code from a short segment of GLSL and pasted it in by hand. It would be nice to automate that somehow. Fixes: glsl-fs-atan-1 glsl-fs-atan-2
* ast: Initialize location data in constructor of all ast_node objects.Carl Worth2010-07-301-1/+3
| | | | | | This prevents using uninitialized data in _msea_glsl_error in some cases, (including at least 6 piglit tests). Thanks to valgrind for pointing out the problem!
* glsl2: Update the callee pointer of calls to newly-linked-in functions.Eric Anholt2010-07-301-0/+2
| | | | | | Otherwise, ir_function_inlining will see the body of the function from the unlinked version of the shader, which won't have had the lowering passes done on it or linking's variable remapping.
* glsl2: Initialize ir_function_signature::is_built_in.Kenneth Graunke2010-07-301-0/+1
| | | | Fixes a valgrind error.
* glcpp: Don't look for backslashes before the beginning of the string.Kenneth Graunke2010-07-301-3/+7
| | | | Fixes a valgrind error.
* glsl2: Do ir_if_return on the way out, not the way in.Eric Anholt2010-07-291-19/+20
| | | | | | | | | | | | | | | The problem with doing it on the way in is that for a function with multiple early returns, we'll move an outer block in, then restart the pass, then move the two inside returns out, then never move outer blocks in again because the remaining early returns are inside an else block and they don't know that there's a return just after their block. By going inside-out, we get the early returns stacked up so that they all move out with a series of move_returns_after_block(). Fixes (on i965): glsl-fs-raytrace-bug27060 glsl-vs-raytrace-bug26691
* glsl2: Make sure functions end with a return before doing ir_if_return.Eric Anholt2010-07-291-1/+61
| | | | | | | | | This catches a few remaining functions that weren't getting inlined, generally operating on global or out variables and using an early return to skip work when possible. Fixes for i965: glsl1-function with early return (3)
* glsl2: Make ir_if_return handle if () { return } else { not return }Eric Anholt2010-07-291-26/+77
| | | | | | | | This makes many remaining functions inlinable. Fixes for i965: glsl1-function with early return (1) glsl1-function with early return (2)
* glsl2: Refactor a bit of ir_if_return for the next changes.Eric Anholt2010-07-291-22/+34
|