Commit graph

37237 commits

Author SHA1 Message Date
Kenneth Graunke
c55aa4292f glsl2: Refresh autogenerated bison parser. 2010-08-13 17:16:43 -07:00
Vinson Lee
07ca55b7fa Fix an MSVC build error (bugzilla 29570). 2010-08-13 17:11:21 -07:00
Ian Romanick
768b55a526 glsl2: Remove unnecessary use of 'struct' before type names
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.
2010-08-13 16:46:43 -07:00
Ian Romanick
d960b61ea3 Add missing intmax_t and uintmax_t 2010-08-13 16:22:38 -07:00
Ian Romanick
a77a6bc008 glsl2: Use stdint.h instead of inttypes.h 2010-08-13 16:22:21 -07:00
Ian Romanick
23f6017d70 glsl2: Commit generated file changed by previous commit 2010-08-13 14:50:53 -07:00
Ian Romanick
ab18be74ac glsl2: Use --nounistd to fix MSVC build
Also remove the --never-interactive command line option for the
preprocessor lexer.  This was already done for main compiler lexer.
2010-08-13 14:50:53 -07:00
Ian Romanick
c33e78f62b linker: Assign attrib location 0 if gl_Vertex is not used
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).
2010-08-13 14:50:48 -07:00
Jakob Bornecrantz
204d4cbea0 glsl2: Include string.h in preprocessor 2010-08-13 18:36:55 +01:00
Ian Romanick
103453659d glsl2: Commit generated files changed by previous two commits 2010-08-13 09:34:52 -07:00
Ian Romanick
5c77efc0b2 glsl2: Avoid token name collisions with names used by Windows header files 2010-08-13 09:30:56 -07:00
Ian Romanick
5b9f3db719 glsl2: Eliminate tokens for square matrix short names
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.
2010-08-13 09:29:39 -07:00
José Fonseca
3a3cdb909d scons: Build the new glsl2 code. 2010-08-13 13:55:34 +01:00
José Fonseca
1ca2945f84 talloc: Make it compile with MSVC, MinGW, and Xcode/gcc4.0.
Based on Aras Pranckevičius' patch.
2010-08-13 13:53:04 +01:00
José Fonseca
e6032b1d96 talloc: Import 2.0.1 code. 2010-08-13 12:31:10 +01:00
Ian Romanick
0dc39f481a glsl2: Use MIN2 from macros.h instead of open coding it 2010-08-12 18:01:14 -07:00
Ian Romanick
261bbc011d glsl2: Use Elements from main/compiler.h instead of open-coding 2010-08-12 15:05:39 -07:00
Brian Paul
2d83e3fa0d mesa: check for null shader->InfoLog before printing 2010-08-12 16:00:01 -06:00
Ian Romanick
4ca4edd20e glsl2: Commit generated file changed by previous commit 2010-08-12 10:09:05 -07:00
Ian Romanick
188f60fb05 glsl2: Add missing include of string.h
Makes the build happy on non-GCC platforms.
2010-08-12 10:09:05 -07:00
Jakob Bornecrantz
4f51762b07 gallium: Link DRI drivers with g++ and test with CXX
New shader compiler need libc++ runtime. This works already if
we are using llvm so this just covers the !llvm case.
2010-08-12 16:04:11 +01:00
Ian Romanick
5a805079a8 glsl2: Change command line options passed to flex
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.
2010-08-11 17:21:53 -07:00
Ian Romanick
a43871f763 glsl2: Commit generated files changed by previous commit 2010-08-11 17:21:53 -07:00
Ian Romanick
2fb94b37d2 glsl2: Use bison command line option to set prefix
Bison version 2.3 doesn't seem to support %name-prefix in the source.

This should fix bugzilla #29207.
2010-08-11 17:14:02 -07:00
Ian Romanick
db36e88052 glsl2: Commit generated files changed by previous commit 2010-08-11 17:03:37 -07:00
Ian Romanick
77215e7e7b glsl2: Emit error from lexer when illegal reserved word is encountered
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.
2010-08-11 17:03:31 -07:00
Ian Romanick
202604e816 glsl2: Don't declare a variable called sig that shadows the other one
Accidentally having a variable called 'sig' within an if-statement
cause the higher scope 'sig' to always be NULL.  As a result a new
function signature was created for a function definition even when one
already existed from a prototype declaration.

Fixes piglit test case glsl-function-prototype (bugzilla #29520).
2010-08-11 16:58:25 -07:00
Carl Worth
da6b10a7eb glcpp: Fix "unterminated if" diagnostic.
This was previously being appended to the output string *after* a copy
of the supposedly final string was made and handed to the caller. So
the diagnostic was never actually visible to the user.

We fix this by moving the check for an unterminated #if from
glcpp_parser_destroy to the calling function, preprocess.

This fixes the test case 083-unterminated-if.c.
2010-08-11 14:38:04 -07:00
Carl Worth
6b9e7b034c glccp: Regenerate glcpp-parse.c
Due to a recent change to glcpp-parse.y.
2010-08-11 14:38:04 -07:00
Carl Worth
253cad3f42 glcpp: Add an explicit diagnostic for #if with no expression.
This is more clear than the previously-generated diagnostic which was
something confusing like "enexpected newline".

This change makse test 080-if-witout-expression.c now pass.
2010-08-11 14:38:04 -07:00
Carl Worth
624dd585c7 glcpp: Reword diagnostic for #elif with no expression
Rather than telling the user what to fix, the standard convention is to
describe what the detected problem is. With this change, test
081-elif-without-expression now passes.
2010-08-11 14:38:03 -07:00
Carl Worth
cb5ea0c79b glcpp: Add several tests for diagnostics.
Which are proving to be useful since some of these tests are not yet
acting as desired, (in particular, the unterminated if test is not
generating any diagnostic).
2010-08-11 14:38:03 -07:00
Carl Worth
5a6285cc86 glcpp: Regenerate glcpp-lex.c
After a recent change to glcpp-lex.l
2010-08-11 14:38:03 -07:00
Carl Worth
bc64b89808 glcpp: Initialize line and column numbers to 1, not 0.
Error messages make more sense this way since the convention is for
the first line of a file to be numbered from 1, rather than 0.
2010-08-11 14:38:03 -07:00
Carl Worth
2bcff4c879 glcpp-test: Capture the stderr output of the preprocessor.
This allows writing tests that verify diagnostics from the preprocessor.
2010-08-11 14:38:03 -07:00
Brian Paul
dcb3a2899e configs: added -ltalloc to config files 2010-08-11 15:06:13 -06:00
Brian Paul
9b2d3c3285 osmesa: link with new libglsl.a lib 2010-08-11 15:06:13 -06:00
Brian Paul
9f9386d22a glsl2: added casts to silence warnings 2010-08-11 15:06:13 -06:00
Brian Paul
4415a84645 glsl2: remove stray semicolon 2010-08-11 15:06:13 -06:00
Brian Paul
d3b66be3c7 glsl2: added casts to silence warnings 2010-08-11 15:06:12 -06:00
Brian Paul
ffd3f15e96 glsl2: add cast to silence warning 2010-08-11 15:06:12 -06:00
Brian Paul
30d083903f glsl2: remove stray semicolon 2010-08-11 15:06:12 -06:00
Brian Paul
d1dda951c8 glsl2: move declarations before code 2010-08-11 15:06:12 -06:00
Brian Paul
6dc89d221d glsl2: remove trailing comma to silence warning 2010-08-11 15:06:12 -06:00
Carl Worth
8485f4d9aa glcpp: Clean up intermediate file when test suite is interrupted.
The glcpp-test script was leaving around bogus *.valgrind-errors files if
a valgrind test was interrupted.
2010-08-11 12:46:16 -07:00
Carl Worth
764e096647 glcpp: Regenerate glcpp-parse.c
After a recent change to glcpp-parse.y
2010-08-11 12:45:55 -07:00
Carl Worth
48ba058e7a glcpp: Additional fixes for not evaluating skipped #if/#elif expressions.
This adds a couple of test cases to expand our coverage of invalid #if and
being skipped, (either by being nested inside an #if/#elif that evaluates to
zero or by being after an #if/#elif that evaluates to non-zero).
2010-08-11 12:43:44 -07:00
Kenneth Graunke
298a6fcdde glcpp/tests: Commit forgotten file 074-elif-undef.c.expected. 2010-08-10 19:18:44 -07:00
Kenneth Graunke
64b408529a texture_builtins.py: Remove useless comments. 2010-08-10 19:18:44 -07:00
Carl Worth
9b7fd2099f glcpp: Discard output of cmp when running the test suite.
We're already using the return-value of cmp to print either PASS or
FAIL and in the case of failure, we're subsequently running and
showing the output of diff. So any warnings/errors from cmp itself are
not actually needed, and can be quite confusing.
2010-08-10 18:27:31 -07:00