summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glcpp: Fix 064-version.c expected result to track recent change.Carl Worth2010-08-171-1/+0
| | | | | | In commit 6be3a8b70af4ba4fa4d037d54ecf6d5f055edbc9, the #version directive was fixed to stop generating a spurious newline. Here we simply update the expected result for the single test which includes a #version directive.
* glcpp: Regenerated glcpp-lex.c from previous commit.Carl Worth2010-08-171-194/+203
| | | | | The previous commit changed glcpp-lex.l so we commit the resulting generated file here.
* glcpp: Don't include the newline when discarding single-line commentsCarl Worth2010-08-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Matching the newline here meant having to do some redundant work here, (incrementing line number, resetting column number, and returning a NEWLINE token), that could otherwise simply be left to the existing rule which matches a newline. Worse, when the comment rule matches the newline as well, the parser can lookahead and see a token for something that should actually be skipped. For example, in a case like this: #if 0 // comment here fail #else win #endif Both fail and win appear in the output, (not that the condition is being evaluated incorrectly---merely that one token after the comment's newline was being lexed/parse regardless of the condition). This commit fixes the above test case, (which is also remarkably similar to 087-if-comments which now passes).
* glcpp: Add testcase for #if handling bug that breaks Savage2.Eric Anholt2010-08-172-0/+11
|
* glsl2: Fix transpose of rows and colsIan Romanick2010-08-171-2/+2
| | | | | | | | | This error led to an assertion failure for some constructors of non-square matrices. It only occured in matrices where the number of columns was greater than the number of rows. It didn't even always occur on those. Fixes piglit glslparsertest case constructor-16.vert.
* linker: Demote user-defined varyings in the VS-only caseIan Romanick2010-08-171-14/+28
| | | | Fixes piglit test case glsl-vs-ff-frag and bugzilla #29623.
* glsl: When doing algebraic simplification, make sure the type still matches.Eric Anholt2010-08-171-12/+34
| | | | | | | | | | | | When simplifying (vec4(1.0) / (float(x))) to rcp(float(x)), we forgot to produce a vec4, angering ir_validate when starting alien-arena. Fixes: glsl-algebraic-add-zero-2 glsl-algebraic-div-one-2 glsl-algebraic-mul-one-2 glsl-algebraic-sub-zero-3 glsl-algebraic-rcp-sqrt-2
* glsl: Make ir_algebraic new expressions allocate out of the parent.Eric Anholt2010-08-171-16/+22
| | | | | This could reduce the amount of memory used by a shader tree after optimization, and increases consistency with other passes.
* ir_constant: Don't assert on out-of-bounds array accessesIan Romanick2010-08-171-1/+15
| | | | | | | | | Several optimization paths, including constant folding, can lead to accessing an ir_constant array with an out of bounds index. The GLSL spec lets us produce "undefined" results, but it does not let us crash. Fixes piglit test case glsl-array-bounds-01 and glsl-array-bounds-03.
* Merge branch 'glsl2'Ian Romanick2010-08-16418-48/+78185
|\ | | | | | | | | Conflicts: src/mesa/program/prog_optimize.c
| * glsl2: Refresh autogenerated file builtin_function.cpp.Kenneth Graunke2010-08-161-1952/+11534
| |
| * glsl2: Add builtins profile for GLSL 1.30.Kenneth Graunke2010-08-162-0/+1986
| | | | | | | | | | Many functions are currently wrapped with #if 0 since we haven't implemented them yet.
| * linker: Include compiler.h to avoid spurious warnings about INLINEIan Romanick2010-08-161-0/+1
| |
| * glsl2: Silence unused variable warningIan Romanick2010-08-161-0/+1
| |
| * glcpp: Refresh autogenerated lexer and parser.Kenneth Graunke2010-08-162-60/+44
| |
| * glcpp: Remove spurious newline generated by #version handling.Kenneth Graunke2010-08-162-4/+2
| | | | | | | | | | | | This was causing line numbering to be off by one. The newline comes from the NEWLINE token at the end of the line; there's no need to insert one.
| * Revert "glsl2: Use stdint.h instead of inttypes.h"José Fonseca2010-08-144-4/+4
| | | | | | | | This reverts commit a77a6bc008b3146c56431fa520a00e1f8dfa3938.
| * glsl: Standardize a few more uses of struct vs class keyword.José Fonseca2010-08-145-12/+13
| |
| * glsl: Silence gcc warning "control reaches end of non-void function".José Fonseca2010-08-141-1/+1
| |
| * scons: Add new source files.José Fonseca2010-08-141-0/+2
| |
| * glsl2/Makefile: Add a 'make builtins' target.Kenneth Graunke2010-08-131-1/+6
| | | | | | | | | | | | | | | | | | This copies over a dummy builtin_functions.cpp and rebuilds a bootstrapped version of the compiler, then uses that to generate the proper list of builtins. Finally, it rebuilds the compiler with the new list. Unfortunately, it's no longer automatic, but at least it works.
| * glsl2: Rework builtin function generation.Kenneth Graunke2010-08-13102-5685/+15738
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each language version/extension and target now has a "profile" containing all of the available builtin function prototypes. These are written in GLSL, and come directly out of the GLSL spec (except for expanding genType). A new builtins/ir/ folder contains the hand-written IR for each builtin, regardless of what version includes it. Only those definitions that have prototypes in the profile will be included. The autogenerated IR for texture builtins is no longer written to disk, so there's no longer any confusion as to what's hand-written or generated. All scripts are now in python instead of perl.
| * ir_reader: Don't mark functions as defined if their body is empty.Kenneth Graunke2010-08-131-1/+1
| |
| * glsl2: Commit generated file change by commit ab18be74Ian Romanick2010-08-131-10/+2
| | | | | | | | | | This would have been included in commit 23f6017d, but make wisely did not regenerate the file when the .lpp file did not change.
| * glsl2: Add a pass to strip out noop swizzles.Eric Anholt2010-08-134-0/+83
| | | | | | | | | | | | With the glsl2-965 branch, the optimization of glsl-algebraic-rcp-rcp regressed due to noop swizzles hiding information from ir_algebraic. This cleans up those noop swizzles for us.
| * glsl2: Convert ir_constant_propagation to ir_rvalue_visitor.Eric Anholt2010-08-131-55/+9
| | | | | | | | This one is a little tricky because of the LHS handling.
| * glsl2: Add a generic visitor class to call back with pointers to each rvalue.Eric Anholt2010-08-135-208/+203
| | | | | | | | | | I keep copy and pasting this code all over, so consolidate it in one place.
| * glsl2: Add support for ir_unop_neg to ir_mat_op_to_vecEric Anholt2010-08-131-0/+24
| |
| * glsl2: Move the common optimization passes to a helper function.Eric Anholt2010-08-133-41/+43
| | | | | | | | | | These are passes that we expect all codegen to be happy with. The other lowering passes for Mesa IR are moved to the Mesa IR generator.
| * glsl2: Refresh autogenerated bison parser.Kenneth Graunke2010-08-132-118/+125
| |
| * Fix an MSVC build error (bugzilla 29570).Vinson Lee2010-08-131-1/+1
| |
| * glsl2: Remove unnecessary use of 'struct' before type namesIan Romanick2010-08-136-58/+57
| | | | | | | | | | | | | | | | In C++ you don't have to say 'struct' or 'class' if the declaration of the type has been seen. Some compilers will complain if you use 'struct' when 'class' should have been used and vice versa. Fixes bugzilla #29539.
| * glsl2: Use stdint.h instead of inttypes.hIan Romanick2010-08-134-4/+4
| |
| * glsl2: Commit generated file changed by previous commitIan Romanick2010-08-131-55/+47
| |
| * glsl2: Use --nounistd to fix MSVC buildIan Romanick2010-08-132-2/+3
| | | | | | | | | | Also remove the --never-interactive command line option for the preprocessor lexer. This was already done for main compiler lexer.
| * linker: Assign attrib location 0 if gl_Vertex is not usedIan Romanick2010-08-131-1/+36
| | | | | | | | | | | | | | If gl_Vertex is not used in the shader, then attribute location 0 is available for use. Fixes piglit test case glsl-getattriblocation (bugzilla #29540).
| * glsl2: Include string.h in preprocessorJakob Bornecrantz2010-08-131-0/+1
| |
| * glsl2: Commit generated files changed by previous two commitsIan Romanick2010-08-133-1403/+1314
| |
| * glsl2: Avoid token name collisions with names used by Windows header filesIan Romanick2010-08-132-31/+31
| |
| * glsl2: Eliminate tokens for square matrix short namesIan Romanick2010-08-132-7/+4
| | | | | | | | | | | | MAT2 and MAT2X2, for example, are treated identically by the parser. The language version based error checking (becuase mat2x2 is not available in GLSL 1.10) is already done in the lexer.
| * scons: Build the new glsl2 code.José Fonseca2010-08-131-40/+72
| |
| * glsl2: Use MIN2 from macros.h instead of open coding itIan Romanick2010-08-121-11/+7
| |
| * glsl2: Use Elements from main/compiler.h instead of open-codingIan Romanick2010-08-125-16/+4
| |
| * glsl2: Commit generated file changed by previous commitIan Romanick2010-08-121-0/+1
| |
| * glsl2: Add missing include of string.hIan Romanick2010-08-121-107/+108
| | | | | | | | Makes the build happy on non-GCC platforms.
| * glsl2: Change command line options passed to flexIan Romanick2010-08-111-1/+1
| | | | | | | | | | | | | | | | | | Remove --never-interactive because it is already specified in the source using %option. Use -o instead of --outfile. Some of the %option commands may also need to be removed for compatibility with older versions (e.g., 2.5.4) of flex. This should fix bugzilla #29209.
| * glsl2: Commit generated files changed by previous commitIan Romanick2010-08-112-249/+249
| |
| * glsl2: Use bison command line option to set prefixIan Romanick2010-08-112-2/+1
| | | | | | | | | | | | Bison version 2.3 doesn't seem to support %name-prefix in the source. This should fix bugzilla #29207.
| * glsl2: Commit generated files changed by previous commitIan Romanick2010-08-113-1259/+1287
| |
| * glsl2: Emit error from lexer when illegal reserved word is encounteredIan Romanick2010-08-112-41/+53
| | | | | | | | | | | | | | | | Without this, the parser will generate obtuse, useless error diagnostics when reservered word that are not used by the grammar are encountered in a shader. Fixes bugzilla #29519.