summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp
Commit message (Collapse)AuthorAgeFilesLines
* glcpp: Refresh autogenerated lexer and parser files.Ian Romanick2011-01-101-184/+181
| | | | For the previous commit.
* glcpp: Generate an error for division by zeroIan Romanick2011-01-101-1/+6
| | | | | | | | | | | | | | | | | | | | When GCC encounters a division by zero in a preprocessor directive, it generates an error. Since the GLSL spec says that the GLSL preprocessor behaves like the C preprocessor, we should generate that same error. It's worth noting that I cannot find any text in the C99 spec that says this should be an error. The only text that I can find is line 5 on page 82 (section 6.5.5 Multiplicative Opertors), which says, "The result of the / operator is the quotient from the division of the first operand by the second; the result of the % operator is the remainder. In both operations, if the value of the second operand is zero, the behavior is undefined." Fixes 093-divide-by-zero.c test and bugzilla #32831. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glcpp: Regenerate glcpp-parse.cChad Versace2011-01-101-0/+21
|
* glcpp: Fix segfault when validating macro redefinitionsChad Versace2011-01-101-0/+21
| | | | | | | | In _token_list_equal_ignoring_space(token_list_t*, token_list_t*), add a guard that prevents dereferncing a null token list. This fixes test src/glsl/glcpp/tests/092-redefine-macro-error-2.c and Bugzilla #32695.
* glcpp: Add test for recursive #define.Vinson Lee2011-01-041-0/+3
|
* glcpp: Add division by zero test cases.Vinson Lee2011-01-042-0/+4
|
* glcpp: Add negative tests for redefintions with valueless macros.Vinson Lee2010-12-272-0/+15
|
* Refresh autogenerated glcpp parser.Kenneth Graunke2010-12-071-47/+46
|
* glcpp: Don't emit SPACE tokens in conditional_tokens production.Kenneth Graunke2010-12-071-1/+0
| | | | | | | | Fixes glslparsertest defined-01.vert. Reported-by: José Fonseca <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* Regenerate glcpp parser.Kenneth Graunke2010-11-171-85/+90
|
* glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.Kenneth Graunke2010-11-171-1/+6
| | | | | | | | | This is really supposed to be defined only if the driver supports highp in the fragment shader - but all of our current ES2 implementations do. So, just define it. In the future, we'll need to add a flag to gl_context and only define the macro if the flag is set. "Fixes" freedesktop.org bug #31673.
* Refresh autogenerated glcpp parser.Kenneth Graunke2010-11-162-200/+210
|
* glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version >= 1.30.Kenneth Graunke2010-11-161-0/+3
| | | | Per section 4.5.4 of the GLSL 1.30 specification.
* r600g: implement texture_get_handle (needed for eglExportDRMImageMESA)Benjamin Franzke2010-11-081-6/+2
|
* glcpp: Refresh autogenerated lexer file.Kenneth Graunke2010-10-211-23/+13
|
* glcpp: Return NEWLINE token for newlines inside multi-line comments.Kenneth Graunke2010-10-211-2/+2
| | | | This is necessary for the main compiler to get correct line numbers.
* glsl: Slightly change the semantic of _LinkedShadersIan Romanick2010-10-141-0/+8
| | | | | | | | | | | | | | | Previously _LinkedShaders was a compact array of the linked shaders for each shader stage. Now it is arranged such that each slot, indexed by the MESA_SHADER_* defines, refers to a specific shader stage. As a result, some slots will be NULL. This makes things a little more complex in the linker, but it simplifies things in other places. As a side effect _NumLinkedShaders is removed. NOTE: This may be a candidate for the 7.9 branch. If there are other patches that get backported to 7.9 that use _LinkedShader, this patch should be cherry picked also.
* glcpp: Regenerate files changes by previous commitIan Romanick2010-10-082-124/+120
|
* glcpp: Add the define for ARB_explicit_attrib_location when presentIan Romanick2010-10-081-0/+3
|
* glcpp: Fix build on non-GCC compilers.Kenneth Graunke2010-09-072-90/+92
|
* glsl: Define GL_ES preprocessor macro if API is OpenGL ES 2.0.Kenneth Graunke2010-09-076-225/+247
| | | | Also define it if #version 100 is encountered.
* glsl2: remove 'extern' keyword in .c fileBrian Paul2010-08-271-1/+1
|
* glsl/mesa: fixes for MSVCAras Pranckevicius2010-08-251-0/+1
| | | | Signed-off-by: Brian Paul <[email protected]>
* glsl: Include main/core.h.Chia-I Wu2010-08-242-2/+2
| | | | Make glsl include only main/core.h from core mesa.
* glcpp: Make standalone preprocessor work with a tty as stdinCarl Worth2010-08-231-33/+49
| | | | | | | | | | | | Previously glcpp would silently abort if it couldn't fstat the file being read, (so it would work with stdin redirected from a file, but would not work with stdin as a tty). The stat was so that glcpp could allocate a buffer for the file content in a single call. We now use talloc_realloc instead, (even if the fstat is possible). This is theoretically less efficient, but quite irrelevant, (particularly because the standalone preprocessor is used only for testing).
* glcpp: Fix test suite to avoid flagging failed tests as valgrind errors.Carl Worth2010-08-231-4/+5
| | | | | | | | | | We recently added several tests that intentionally trigger preprocessor errors. During valgrind-based testing, our test script was noticing the non-zero return value from the preprocessor and incorrectly flagging the valgrind-based test as failing. To fix this, we make valgrind return an error code that is otherwise unused by the preprocessor.
* glcpp: Fix segfault in standalone preprocessor for "file not found", etc.Carl Worth2010-08-231-4/+17
| | | | | | | | This error message was missing so that the program would simply segfault if the provided filename could not be opened for some reason. While we're at it, we add explicit support for a filename of "-" to indicate input from stdin.
* glcpp: Update generated glcpp-lex.c for the last two changes.Carl Worth2010-08-231-191/+186
| | | | | This fixes both "#line 0" and "#line XXX YYY" as described in the two most recent commits.
* glcpp: Fix handling of "#line 0"Carl Worth2010-08-231-2/+3
| | | | | | | | | | | | | | | | The existing DECIMAL_INTEGER pattern is the correct thing to use when looking for a C decimal integer, (that is, a digit-sequence not starting with 0 which would instead be an octal integer). But for #line, we really want to accept any digit sequence, (including "0"), and always interpret it as a decimal constant. So we add a new DIGITS pattern for this case. This should fix the compilation failure noted in bug #28138 https://bugs.freedesktop.org/show_bug.cgi?id=28138 (Though the generated file will not be updated until the next commit.)
* glcpp: Fix source numbers set with "#line LINE_NUMBER SOURCE_NUMBER"Carl Worth2010-08-231-2/+7
| | | | | | | Previously, the YY_USER_ACTION was overwriting the yylloc->source value in every action, (after that value had been carefully set by the handling of the #line directive). Instead, we want to initialize it once in YY_USER_INIT and then not touch it at all in YY_USER_ACTION.
* glcpp: Add new test for #line directive.Carl Worth2010-08-232-0/+21
| | | | | | | | | | | | This test exposes two current bugs: 1. The source number is not being correctly emitted in error messages (instead, it's always 0). 2. A directive of "#line 0" is resulting in the following parse error: preprocessor error: Invalid tokens after #
* glcpp: Update README file (new specifications and fewer limitations).Carl Worth2010-08-231-12/+14
| | | | | | | The README file had grown a little bit stale. We've been using newer versions of both the GLSL and C99 specifications, so list those. Also, several of the documented known limitations have since been fixed, so remove those.
* glcpp: Add test for the #error directive.Carl Worth2010-08-232-0/+4
| | | | | | | This directive is already implemented nicely, but wasn't previously tested. It will be convenient to use this directive in further tests that rely on error messages, (such as ensuring that #line correctly sets the line number in the error message).
* glcpp: Refresh autogenerated lexer.Kenneth Graunke2010-08-181-263/+326
|
* glcpp: Add basic #line support (adapted from the main compiler).Kenneth Graunke2010-08-181-0/+31
|
* glcpp: Refresh generated files.Carl Worth2010-08-172-229/+343
| | | | After a recent change to glcpp-parse.y (adding "redefined macro" error).
* glcpp: Add support for "redefined macro" error.Carl Worth2010-08-171-2/+123
| | | | | | | | | Carefully avoiding printing any error when the new definition matches the existing definition. This fixes the recently-added 088-redefine-macro-legitimate.c and 089-redefine-macro-error.c tests as well as glsparsertest/preprocess1 in piglit.
* glcpp: Add two new tests for testing redefined macros.Carl Worth2010-08-174-0/+58
| | | | | | The specification says that redefining a macro is an error, unless the new definitions is identical to the old one, (identical replacement lists but ignoring differing amounts of whitespace).
* glcpp: Allow standalone glcpp to accept a filename as first argument.Carl Worth2010-08-171-3/+11
| | | | This is useful for debugging the preprocessor.
* 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
|
* 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-142-2/+2
| | | | This reverts commit a77a6bc008b3146c56431fa520a00e1f8dfa3938.
* 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: Use stdint.h instead of inttypes.hIan Romanick2010-08-132-2/+2
|
* glsl2: Commit generated file changed by previous commitIan Romanick2010-08-131-55/+47
|