summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast.h
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Silence "ast_to_hir.cpp:1984:25: warning: comparison of unsigned ↵Ian Romanick2011-09-091-1/+1
| | | | | | | | | | | expression >= 0 is always true" ast_type_qualifier::location should have been a signed integer from the beginning, and the giant comment in apply_type_qualifier_to_variable explains why. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40207 Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Emit function signatures at toplevel, even for built-ins.Paul Berry2011-08-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ast-to-hir conversion needs to emit function signatures in two circumstances: when a function declaration (or definition) is encountered, and when a built-in function is encountered. To avoid emitting a function signature in an illegal place (such as inside a function), emit_function() checked whether we were inside a function definition, and if so, emitted the signature before the function definition. However, this didn't cover the case of emitting function signatures for built-in functions when those built-in functions are called from inside the constant integer expression that specifies the length of a global array. This failed because when processing an array length, we are emitting IR into a dummy exec_list (see process_array_type() in ast_to_hir.cpp). process_array_type() later checks (via an assertion) that no instructions were emitted to the dummy exec_list, based on the reasonable assumption that we shouldn't need to emit instructions to calculate the value of a constant. This patch changes emit_function() so that it emits function signatures at toplevel in all cases. This partially fixes bug 38625 (https://bugs.freedesktop.org/show_bug.cgi?id=38625). The remainder of the fix is in the patch that follows. Reviewed-by: Kenneth Graunke <[email protected]>
* Convert everything from the talloc API to the ralloc API.Kenneth Graunke2011-01-311-5/+5
|
* glsl: Add depth layout qualifiers to ast_type_qualifierChad Versace2011-01-261-0/+8
|
* glsl: Remove unused class ast_declaration_statmentChad Versace2011-01-211-19/+0
|
* glsl: Add support for default precision statementsChad Versace2011-01-171-2/+6
| | | | | | * Add new field ast_type_specifier::is_precision_statement. * Add semantic checks in ast_type_specifier::hir(). * Alter parser rules accordingly.
* glsl: Change default value of ast_type_specifier::precisionChad Versace2011-01-171-3/+4
| | | | | | | | 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 interpolation qualifiers do not precede 'varying'Chad Versace2011-01-171-0/+5
| | | | | | | | | | | | | ... 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-171-0/+12
| | | | | | 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".
* glsl: Comment ast_type_qualifier.flagsChad Versace2011-01-041-1/+5
|
* glsl: Factor out code which emits a new function into the IR stream.Kenneth Graunke2010-12-061-0/+4
| | | | A future commit will use the newly created function in a second place.
* glsl: Add parser support for GL_ARB_explicit_attrib_location layoutsIan Romanick2010-10-081-0/+14
| | | | | Only layout(location=#) is supported. Setting the index requires GLSL 1.30 and GL_ARB_blend_func_extended.
* glsl: Wrap ast_type_qualifier contents in a struct in a unionIan Romanick2010-10-081-17/+22
| | | | This will ease adding non-bit fields in the near future.
* glsl: Add doxygen commentsIan Romanick2010-09-201-4/+38
|
* glsl2: Remove unnecessary use of 'struct' before type namesIan Romanick2010-08-131-3/+2
| | | | | | | | 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 talloc_zero_size instead of talloc_size to allocate ast_node objects.Carl Worth2010-08-021-1/+1
| | | | | | This is a zero-ing function, (like calloc), to avoid bugs due to accessing uninitialized values. Thanks to valgrind for noticing the use of uninitialized values.
* glsl2: Also initialize the identifier field of parameter_declarator.Eric Anholt2010-08-021-0/+1
| | | | | | The non-named parameter grammar understandably doesn't set the identifier field. Fixes intermittent failures about void main(void) {} having a named void parameter.
* glsl2: initialize is_array and array_size of ast_parameter_declaratorAras Pranckevicius2010-08-021-0/+6
| | | | The non-array path of glsl_parser.ypp wasn't setting is_array to false.
* glsl2: Parser support for GL_ARB_fragment_coord_conventionsIan Romanick2010-07-281-0/+6
|
* glsl2: Add a method for querying if an AST type has any qualifiers.Kenneth Graunke2010-06-291-0/+1
|
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+651