summaryrefslogtreecommitdiff
path: root/src/glsl
AgeCommit message (Collapse)Author
2011-01-19Add machine generated files to .gitignoretwied
2011-01-19glsl: Don't bother unsetting a destructor that was never set.Kenneth Graunke
This was totally copied and pasted from glsl_symbol_table.
2011-01-18glsl: Fix segfault due to missing printf argumentChad Versace
Fixes the following Piglit tests: glslparsertest/shaders/array2.frag glslparsertest/shaders/dataType6.frag NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-18glsl: Fix semantic checks on precision qualifiersChad Versace
The check for Precision qualifiers only apply to floating point and integer types. was incomplete. It rejected only type 'bool' and structures.
2011-01-18glsl: Skip the rest of loop unrolling if no loops were found.Eric Anholt
Shaves 1.6% (+/- 1.0%) off of ff_fragment_shader glean texCombine time (n=5).
2011-01-17glsl: Refresh autogenerated parser filesChad Versace
2011-01-17glsl: Remove redundant semantic check in parserChad Versace
The removed semantic check also exists in ast_type_specifier::hir(), which is a more natural location for it. The check verified that precision statements are applied only to types float and int.
2011-01-17glsl: Add support for default precision statementsChad Versace
* Add new field ast_type_specifier::is_precision_statement. * Add semantic checks in ast_type_specifier::hir(). * Alter parser rules accordingly.
2011-01-17glsl: Add semantic checks for precision qualifiersChad Versace
* Check that precision qualifiers only appear in language versions 1.00, 1.30, and later. * Check that precision qualifiers do not apply to bools and structs. Fixes the following Piglit tests: * spec/glsl-1.30/precision-qualifiers/precision-bool-01.frag * spec/glsl-1.30/precision-qualifiers/precision-struct-01.frag * spec/glsl-1.30/precision-qualifiers/precision-struct-02.frag
2011-01-17glsl: Fix parser rule for type_specifierChad Versace
Do not assign a value to ast_type_specifier::precision when no precision qualifier is present.
2011-01-17glsl: Change default value of ast_type_specifier::precisionChad Versace
Change default value to ast_precision_none, which denotes the absence of a precision of a qualifier. Previously, the default value was ast_precision_high. This made it impossible to detect if a precision qualifier was present or not.
2011-01-17glsl: Check that 'centroid in' does not occur in vertex shaderChad Versace
The check is performed only in GLSL versions >= 1.30. From section 4.3.4 of the GLSL 1.30 spec: "It is an error to use centroid in in a vertex shader." Fixes Piglit test spec/glsl-1.30/compiler/storage-qualifiers/vs-centroid-in-01.vert
2011-01-17glsl: Check that interpolation quals only apply to vertex ins and fragment outsChad Versace
The check is performed only in GLSL versions >= 1.30. Fixes the following Piglit tests: * spec/glsl-1.30/compiler/interpolation-qualifiers/fs-smooth-02.frag * spec/glsl-1.30/compiler/interpolation-qualifiers/vs-smooth-01.vert
2011-01-17glsl: Check that interpolation qualifiers do not precede 'varying'Chad Versace
... and 'centroid varying'. The check is performed only in GLSL versions >= 1.30. From page 29 (page 35 of the PDF) of the GLSL 1.30 spec: "interpolation qualifiers may only precede the qualifiers in, centroid in, out, or centroid out in a declaration. They do not apply to the deprecated storage qualifiers varying or centroid varying." Fixes Piglit test spec/glsl-1.30/compiler/interpolation-qualifiers/smooth-varying-01.frag.
2011-01-17glsl: Add method ast_type_qualifier::interpolation_string()Chad Versace
If an interpolation qualifier is present, then the method returns that qualifier's string representation. For example, if the noperspective bit is set, then it returns "noperspective".
2011-01-15Merge branch 'draw-instanced'Brian Paul
Conflicts: src/gallium/auxiliary/draw/draw_llvm.c src/gallium/drivers/llvmpipe/lp_state_fs.c src/glsl/ir_set_program_inouts.cpp src/mesa/tnl/t_vb_program.c
2011-01-14glsl: fix implicit int to bool warningBrian Paul
Maybe preprocess() should return a bool.
2011-01-14generate_builtins.py: Whitespace fixes.Vinson Lee
Also removed unnecessary semicolons.
2011-01-14generate_builtins.py: Fix builds using Python 2.5.Vinson Lee
2011-01-13glsl: Emit errors or warnings when 'layout' is used with 'attribute' or ↵Ian Romanick
'varying' The specs that add 'layout' require the use of 'in' or 'out'. However, a number of implementations, including Mesa, shipped several of these extensions allowing the use of 'varying' and 'attribute'. For these extensions only a warning is emitted. This differs from the behavior of Mesa 7.10. Mesa 7.10 would only accept 'attribute' with 'layout(location)'. This behavior was clearly wrong. Rather than carrying the broken behavior forward, we're just doing the correct thing. This is related to (piglit) bugzilla #31804. NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-13glsl: Allow 'in' and 'out' when 'layout' is also availableIan Romanick
All of the extensions that add the 'layout' keyword also enable (and required) the use of 'in' and 'out' with shader globals. This is related to (piglit) bugzilla #31804. NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-13scons: Fix cross-compilation.José Fonseca
Hairy stuff. Don't know how to do it better though.
2011-01-12glsl/s_expression: Read and ignore Scheme-style comments.Kenneth Graunke
A single-semicolon until the end of the line, i.e. ; this is a comment.
2011-01-12glsl/builtins: Remove unnecessary (constant bool (1)) from assignments.Kenneth Graunke
This isn't strictly necessary, but is definitely nicer.
2011-01-12ir_reader: Make assignment conditions optional.Kenneth Graunke
You can now simply write (assign (xy) <lhs> <rhs>) instead of the verbose (assign (constant bool (1)) (xy) <lhs> <rhs>).
2011-01-12ir_reader: Convert to a class.Kenneth Graunke
This makes it unnecessary to pass _mesa_glsl_parse_state around everywhere, making at least the prototypes a lot easier to read. It's also more C++-ish than a pile of static C functions.
2011-01-12ir_reader: Combine the three dereference reading functions into one.Kenneth Graunke
These used to be more complicated, but now are so simple there's no real point in keeping them separate.
2011-01-12ir_reader: Relax requirement that function arguments be s_lists.Kenneth Graunke
All of these functions used to take s_list pointers so they wouldn't all need SX_AS_LIST conversions and error checking. However, the new pattern matcher conveniently does this for us in one centralized place. So there's no need to insist on s_list. Switching to s_expression saves a bit of code and is somewhat cleaner.
2011-01-12ir_reader: Remove s_list::length() method.Kenneth Graunke
Most code now relies on the pattern matcher rather than this function, and for the only remaining case, not using this saves an iteration.
2011-01-12ir_reader: Add a pattern matching system and use it everywhere.Kenneth Graunke
Previously, the IR reader was riddled with code that: 1. Checked for the right number of list elements (via a linked list walk) 2. Retrieved references to each component (via ->next->next pointers) 3. Downcasted as necessary to make sure that each sub-component was the right type (i.e. symbol, int, list). 4. Checking that the tag (i.e. "declare") was correct. This was all very ad-hoc and a bit ugly. Error checking had to be done at both steps 1, 3, and 4. Most code didn't even check the tag, relying on the caller to do so. Not all callers did. The new pattern matching module performs the whole process in a single straightforward function call, resulting in shorter, more readable code. Unfortunately, MSVC does not support C99-style anonymous arrays, so the pattern must be declared outside of the match call.
2011-01-12glsl: remove trailing comma to silence warningBrian Paul
2011-01-12glsl/Makefile: Fix build with --as-needed.Kenneth Graunke
2011-01-12glsl: Track variable usage, use that to enforce semanticsIan Romanick
In particular, variables cannot be redeclared invariant after being used. Fixes piglit test invariant-05.vert and bugzilla #29164. NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12generate_builtins.py: Add missing import.Vinson Lee
Import sys for sys.exit.
2011-01-12glsl: Make builtin_compiler build on Windows with MSVC.José Fonseca
2011-01-12glsl: Make builtin_compiler portable for non-unices.José Fonseca
2011-01-12getopt: Import OpenBSD getopt implementation for MSVC.José Fonseca
2011-01-11glsl: Add type inference support for remaining expression opcodes.Kenneth Graunke
2011-01-11glsl: Fix the lowering of variable array indexing to not lose write_masks.Eric Anholt
Fixes glsl-complex-subscript on 965.
2011-01-10glsl: Autogenerate builtin_functions.cpp as part of the build process.Kenneth Graunke
Python is already necessary for other parts of Mesa, so there's no reason we can't just generate it. This patch updates both make and SCons to do so.
2011-01-10glsl: Disallow 'in' and 'out' on globals in GLSL 1.20Ian Romanick
Fixes piglit tests glsl-1.20/compiler/qualifiers/in-01.vert and glsl-1.20/compiler/qualifiers/out-01.vert and bugzilla #32910. NOTE: This is a candidate for the 7.9 and 7.10 branches. This patch also depends on the previous two commits.
2011-01-10glsl: Refresh autogenerated parser file.Ian Romanick
For the previous commit.
2011-01-10glsl: Add version_string containing properly formatted GLSL versionIan Romanick
2011-01-10glcpp: Refresh autogenerated lexer and parser files.Ian Romanick
For the previous commit.
2011-01-10glcpp: Generate an error for division by zeroIan Romanick
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.
2011-01-10glcpp: Regenerate glcpp-parse.cChad Versace
2011-01-10glcpp: Fix segfault when validating macro redefinitionsChad Versace
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.
2011-01-10glsl: At link-time, check that globals have matching centroid qualifiersChad Versace
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
2011-01-06glsl: Refresh autogenerated lexer and parser files.Ian Romanick
For the previous commit.
2011-01-06glsl: Support the 'invariant(all)' pragmaIan Romanick
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was simply ignored by the compiler. This adds support for setting all variable invariant. In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs, but a warning is generated. Fixes piglit test glsl-invariant-pragma and bugzilla #31925. NOTE: This is a candidate for the 7.9 and 7.10 branches.