aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Refresh autogenerated parser filesChad Versace2011-01-263-165/+180
| | | | | | For commits titled: glcpp: Conditionally define macro GL_AMD_conservative_depth glsl: Add support for AMD_conservative_depth to parser
* glsl: Add support for AMD_conservative_depth to parserChad Versace2011-01-263-8/+34
| | | | | | | | | | When AMD_conservative_depth is enabled: * Let 'layout' be a token. * Extend the production rule of layout_qualifier_id to process the tokens: depth_any depth_greater depth_less depth_unchanged
* glsl: Add depth layout qualifiers to ast_type_qualifierChad Versace2011-01-261-0/+8
|
* glcpp: Conditionally define macro GL_AMD_conservative_depthChad Versace2011-01-261-0/+2
| | | | | Define macro GL_AMD_conservative_depth to 1 when its extension is enabled.
* linker: Propagate max_array_access while linking functionsIan Romanick2011-01-252-4/+13
| | | | | | | | | Update the max_array_access of a global as functions that use that global are pulled into the linked shader. Fixes piglit test glsl-fs-implicit-array-size-01 and bugzilla #33219. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* linker: Set sizes for non-global arrays as wellIan Romanick2011-01-251-18/+17
| | | | | | | | | Previously only global arrays with implicit sizes would be patched. This causes all arrays that are actually accessed to be sized. Fixes piglit test glsl-fs-implicit-array-size-02. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl: silence uninitialized var warning in read_texture()Brian Paul2011-01-251-1/+4
| | | | And generate an error if the texture pattern is not matched.
* glsl: Fix mingw crosscompileJakob Bornecrantz2011-01-251-0/+1
|
* glsl: Remove long unused 'configure.ac' file.Kenneth Graunke2011-01-241-69/+0
| | | | This was from way back when glsl2 lived in its own repository.
* glsl: Don't assert when the value returned by a function has no rvalueIan Romanick2011-01-221-13/+12
| | | | | | | | | | | | | | | The rvalue of the returned value can be NULL if the shader says 'return foo();' and foo() is a function that returns void. Existing GLSL specs do *NOT* say that this is an error. The type of the return value is void. If the return type of the function is also void, then this should compile without error. I expect that future versions of the GLSL spec will fix this (wink, wink, nudge, nudge). Fixes piglit test glsl-1.10/compiler/expressions/return-01.vert and bugzilla #33308. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glcpp: Regenerate parser files.Kenneth Graunke2011-01-211-229/+231
|
* glcpp: Remove use of talloc reference counting.Kenneth Graunke2011-01-211-13/+7
| | | | | We almost always want to simply steal; we only need to copy when copying a token list (in which case we're already cloning stuff anyway).
* glsl, i965: Remove unnecessary talloc includes.Kenneth Graunke2011-01-213-12/+0
| | | | These are already picked up by ir.h or glsl_types.h.
* glsl: Improve error message when read-only vars are writtenChad Versace2011-01-212-7/+29
| | | | | | Improves the cases when: * an explicit assignment references the read-only variable * an 'out' or 'inout' function parameter references the read-only variable
* glsl: Mark 'in' variables at global scope as read-onlyChad Versace2011-01-211-1/+2
| | | | | | | Fixes Piglit tests: spec/glsl-1.30/compiler/storage-qualifiers/static-write-centroid-in-01.frag spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-01.frag spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-02.frag
* glsl: Remove unused class ast_declaration_statmentChad Versace2011-01-211-19/+0
|
* Add machine generated files to .gitignoretwied2011-01-191-0/+1
|
* glsl: Don't bother unsetting a destructor that was never set.Kenneth Graunke2011-01-191-6/+3
| | | | This was totally copied and pasted from glsl_symbol_table.
* glsl: Fix segfault due to missing printf argumentChad Versace2011-01-181-1/+2
| | | | | | | | 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.
* glsl: Fix semantic checks on precision qualifiersChad Versace2011-01-181-9/+8
| | | | | | The check for Precision qualifiers only apply to floating point and integer types. was incomplete. It rejected only type 'bool' and structures.
* glsl: Skip the rest of loop unrolling if no loops were found.Eric Anholt2011-01-183-2/+9
| | | | | Shaves 1.6% (+/- 1.0%) off of ff_fragment_shader glean texCombine time (n=5).
* glsl: Refresh autogenerated parser filesChad Versace2011-01-172-431/+442
|
* glsl: Remove redundant semantic check in parserChad Versace2011-01-171-6/+0
| | | | | | | | 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.
* glsl: Add support for default precision statementsChad Versace2011-01-174-9/+67
| | | | | | * Add new field ast_type_specifier::is_precision_statement. * Add semantic checks in ast_type_specifier::hir(). * Alter parser rules accordingly.
* glsl: Add semantic checks for precision qualifiersChad Versace2011-01-171-0/+33
| | | | | | | | | | | * 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
* glsl: Fix parser rule for type_specifierChad Versace2011-01-171-0/+3
| | | | | Do not assign a value to ast_type_specifier::precision when no precision qualifier is present.
* glsl: Change default value of ast_type_specifier::precisionChad Versace2011-01-172-4/+5
| | | | | | | | 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.
* glsl: Check that 'centroid in' does not occur in vertex shaderChad Versace2011-01-171-0/+13
| | | | | | | | | | 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
* glsl: Check that interpolation quals only apply to vertex ins and fragment outsChad Versace2011-01-171-0/+35
| | | | | | | | 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
* glsl: Check that interpolation qualifiers do not precede 'varying'Chad Versace2011-01-173-0/+38
| | | | | | | | | | | | | ... 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.
* glsl: Add method ast_type_qualifier::interpolation_string()Chad Versace2011-01-172-0/+25
| | | | | | 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".
* Merge branch 'draw-instanced'Brian Paul2011-01-156-1/+50
|\ | | | | | | | | | | | | | | 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
| * glsl: add support for system values and GL_ARB_draw_instancedBrian Paul2010-12-086-2/+52
| |
* | glsl: fix implicit int to bool warningBrian Paul2011-01-141-1/+1
| | | | | | | | Maybe preprocess() should return a bool.
* | generate_builtins.py: Whitespace fixes.Vinson Lee2011-01-141-7/+7
| | | | | | | | Also removed unnecessary semicolons.
* | generate_builtins.py: Fix builds using Python 2.5.Vinson Lee2011-01-141-0/+2
| |
* | glsl: Emit errors or warnings when 'layout' is used with 'attribute' or ↵Ian Romanick2011-01-131-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.
* | glsl: Allow 'in' and 'out' when 'layout' is also availableIan Romanick2011-01-131-2/+5
| | | | | | | | | | | | | | | | | | 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.
* | scons: Fix cross-compilation.José Fonseca2011-01-131-30/+39
| | | | | | | | Hairy stuff. Don't know how to do it better though.
* | glsl/s_expression: Read and ignore Scheme-style comments.Kenneth Graunke2011-01-121-6/+15
| | | | | | | | | | A single-semicolon until the end of the line, i.e. ; this is a comment.
* | glsl/builtins: Remove unnecessary (constant bool (1)) from assignments.Kenneth Graunke2011-01-1212-269/+265
| | | | | | | | This isn't strictly necessary, but is definitely nicer.
* | ir_reader: Make assignment conditions optional.Kenneth Graunke2011-01-122-11/+13
| | | | | | | | | | You can now simply write (assign (xy) <lhs> <rhs>) instead of the verbose (assign (constant bool (1)) (xy) <lhs> <rhs>).
* | ir_reader: Convert to a class.Kenneth Graunke2011-01-121-238/+241
| | | | | | | | | | | | | | 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.
* | ir_reader: Combine the three dereference reading functions into one.Kenneth Graunke2011-01-121-83/+36
| | | | | | | | | | These used to be more complicated, but now are so simple there's no real point in keeping them separate.
* | ir_reader: Relax requirement that function arguments be s_lists.Kenneth Graunke2011-01-121-85/+78
| | | | | | | | | | | | | | | | | | 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.
* | ir_reader: Remove s_list::length() method.Kenneth Graunke2011-01-123-18/+8
| | | | | | | | | | Most code now relies on the pattern matcher rather than this function, and for the only remaining case, not using this saves an iteration.
* | ir_reader: Add a pattern matching system and use it everywhere.Kenneth Graunke2011-01-123-308/+294
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | glsl: remove trailing comma to silence warningBrian Paul2011-01-121-1/+1
| |
* | glsl/Makefile: Fix build with --as-needed.Kenneth Graunke2011-01-121-1/+1
| |
* | glsl: Track variable usage, use that to enforce semanticsIan Romanick2011-01-123-2/+26
| | | | | | | | | | | | | | | | | | 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.