glsl: move to compiler/
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 18 Jan 2016 10:16:48 +0000 (12:16 +0200)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 26 Jan 2016 16:08:33 +0000 (16:08 +0000)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
948 files changed:
configure.ac
src/Makefile.am
src/SConscript
src/compiler/Makefile.am
src/compiler/Makefile.sources
src/compiler/SConscript
src/compiler/glsl/.gitignore [new file with mode: 0644]
src/compiler/glsl/Android.gen.mk [new file with mode: 0644]
src/compiler/glsl/Android.mk [new file with mode: 0644]
src/compiler/glsl/Makefile.am [new file with mode: 0644]
src/compiler/glsl/Makefile.sources [new file with mode: 0644]
src/compiler/glsl/README [new file with mode: 0644]
src/compiler/glsl/SConscript [new file with mode: 0644]
src/compiler/glsl/TODO [new file with mode: 0644]
src/compiler/glsl/ast.h [new file with mode: 0644]
src/compiler/glsl/ast_array_index.cpp [new file with mode: 0644]
src/compiler/glsl/ast_expr.cpp [new file with mode: 0644]
src/compiler/glsl/ast_function.cpp [new file with mode: 0644]
src/compiler/glsl/ast_to_hir.cpp [new file with mode: 0644]
src/compiler/glsl/ast_type.cpp [new file with mode: 0644]
src/compiler/glsl/blob.c [new file with mode: 0644]
src/compiler/glsl/blob.h [new file with mode: 0644]
src/compiler/glsl/builtin_functions.cpp [new file with mode: 0644]
src/compiler/glsl/builtin_types.cpp [new file with mode: 0644]
src/compiler/glsl/builtin_variables.cpp [new file with mode: 0644]
src/compiler/glsl/glcpp/.gitignore [new file with mode: 0644]
src/compiler/glsl/glcpp/README [new file with mode: 0644]
src/compiler/glsl/glcpp/glcpp-lex.l [new file with mode: 0644]
src/compiler/glsl/glcpp/glcpp-parse.y [new file with mode: 0644]
src/compiler/glsl/glcpp/glcpp.c [new file with mode: 0644]
src/compiler/glsl/glcpp/glcpp.h [new file with mode: 0644]
src/compiler/glsl/glcpp/pp.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/.gitignore [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/000-content-with-spaces.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/000-content-with-spaces.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/001-define.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/001-define.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/002-define-chain.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/002-define-chain.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/003-define-chain-reverse.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/003-define-chain-reverse.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/004-define-recursive.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/004-define-recursive.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/005-define-composite-chain.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/005-define-composite-chain.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/006-define-composite-chain-reverse.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/007-define-composite-recursive.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/007-define-composite-recursive.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/008-define-empty.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/008-define-empty.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/009-undef.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/009-undef.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/010-undef-re-define.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/010-undef-re-define.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/011-define-func-empty.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/011-define-func-empty.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/012-define-func-no-args.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/012-define-func-no-args.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/013-define-func-1-arg-unused.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/014-define-func-2-arg-unused.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/015-define-object-with-parens.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/015-define-object-with-parens.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/016-define-func-1-arg.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/016-define-func-1-arg.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/017-define-func-2-args.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/017-define-func-2-args.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/018-define-func-macro-as-parameter.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/019-define-func-1-arg-multi.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/020-define-func-2-arg-multi.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/021-define-func-compose.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/021-define-func-compose.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/022-define-func-arg-with-parens.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/023-define-extra-whitespace.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/023-define-extra-whitespace.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/024-define-chain-to-self-recursion.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/025-func-macro-as-non-macro.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/026-define-func-extra-newlines.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/027-define-chain-obj-to-func.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/032-define-func-self-recurse.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/032-define-func-self-recurse.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/033-define-func-self-compose.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/033-define-func-self-compose.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/034-define-func-self-compose-non-func.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/037-finalize-unexpanded-macro.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/038-func-arg-with-commas.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/038-func-arg-with-commas.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/040-token-pasting.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/040-token-pasting.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/041-if-0.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/041-if-0.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/042-if-1.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/042-if-1.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/043-if-0-else.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/043-if-0-else.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/044-if-1-else.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/044-if-1-else.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/045-if-0-elif.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/045-if-0-elif.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/046-if-1-elsif.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/046-if-1-elsif.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/047-if-elif-else.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/047-if-elif-else.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/048-if-nested.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/048-if-nested.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/049-if-expression-precedence.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/049-if-expression-precedence.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/050-if-defined.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/050-if-defined.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/051-if-relational.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/051-if-relational.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/052-if-bitwise.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/052-if-bitwise.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/053-if-divide-and-shift.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/053-if-divide-and-shift.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/054-if-with-macros.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/054-if-with-macros.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/056-macro-argument-with-comma.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/057-empty-arguments.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/057-empty-arguments.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/058-token-pasting-empty-arguments.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/059-token-pasting-integer.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/059-token-pasting-integer.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/062-if-0-skips-garbage.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/063-comments.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/063-comments.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/064-version.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/064-version.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/065-if-defined-parens.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/065-if-defined-parens.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/066-if-nospace-expression.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/066-if-nospace-expression.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/067-nested-ifdef-ifndef.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/068-accidental-pasting.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/068-accidental-pasting.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/069-repeated-argument.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/069-repeated-argument.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/070-undefined-macro-in-expression.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/071-punctuator.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/071-punctuator.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/072-token-pasting-same-line.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/072-token-pasting-same-line.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/073-if-in-ifdef.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/073-if-in-ifdef.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/074-elif-undef.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/074-elif-undef.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/075-elif-elif-undef.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/075-elif-elif-undef.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/076-elif-undef-nested.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/076-elif-undef-nested.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/077-else-without-if.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/077-else-without-if.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/078-elif-without-if.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/078-elif-without-if.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/079-endif-without-if.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/079-endif-without-if.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/080-if-without-expression.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/080-if-without-expression.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/081-elif-without-expression.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/081-elif-without-expression.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/082-invalid-paste.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/082-invalid-paste.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/083-unterminated-if.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/083-unterminated-if.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/084-unbalanced-parentheses.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/084-unbalanced-parentheses.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/085-incorrect-argument-count.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/085-incorrect-argument-count.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/086-reserved-macro-names.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/086-reserved-macro-names.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/087-if-comments.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/087-if-comments.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/088-redefine-macro-legitimate.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/089-redefine-macro-error.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/089-redefine-macro-error.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/090-hash-error.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/090-hash-error.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/091-hash-line.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/091-hash-line.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/092-redefine-macro-error-2.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/093-divide-by-zero.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/093-divide-by-zero.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/095-recursive-define.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/095-recursive-define.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/096-paste-twice.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/096-paste-twice.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/097-paste-with-non-function-macro.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/098-elif-undefined.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/098-elif-undefined.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/099-c99-example.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/099-c99-example.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/100-macro-with-colon.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/100-macro-with-colon.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/101-macros-used-twice.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/101-macros-used-twice.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/102-garbage-after-endif.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/102-garbage-after-endif.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/103-garbage-after-else-0.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/103-garbage-after-else-0.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/104-hash-line-followed-by-code.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/104-hash-line-followed-by-code.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/105-multiline-hash-line.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/105-multiline-hash-line.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/106-multiline-hash-if.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/106-multiline-hash-if.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/107-multiline-hash-elif.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/107-multiline-hash-elif.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/108-no-space-after-hash-version.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/108-no-space-after-hash-version.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/109-no-space-after-hash-line.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/109-no-space-after-hash-line.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/113-line-and-file-macros.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/113-line-and-file-macros.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/114-paste-integer-tokens.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/114-paste-integer-tokens.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/115-line-continuations.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/115-line-continuations.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/116-disable-line-continuations.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/116-disable-line-continuations.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/118-comment-becomes-space.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/118-comment-becomes-space.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/119-elif-after-else.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/119-elif-after-else.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/120-undef-builtin.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/121-comment-bug-72686.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/121-comment-bug-72686.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/122-redefine-whitespace.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/123-garbage-after-else-1.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/123-garbage-after-else-1.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/124-preprocessing-numbers.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/124-preprocessing-numbers.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/125-es-short-circuit-undefined.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/125-es-short-circuit-undefined.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/126-garbage-after-directive.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/126-garbage-after-directive.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/127-pragma-empty.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/127-pragma-empty.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/128-space-before-hash.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/128-space-before-hash.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/129-define-non-identifier.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/129-define-non-identifier.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/130-define-comment.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/130-define-comment.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/131-eof-without-newline.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/131-eof-without-newline.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/132-eof-without-newline-define.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/132-eof-without-newline-define.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/133-eof-without-newline-comment.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/133-eof-without-newline-comment.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/134-hash-comment-directive.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/134-hash-comment-directive.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/135-duplicate-parameter.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/135-duplicate-parameter.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/137-expand-macro-after-period.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/137-expand-macro-after-period.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/139-define-without-macro-name.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/139-define-without-macro-name.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/140-null-directive.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/140-null-directive.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/141-pragma-and-__LINE__.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/142-defined-within-macro.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/142-defined-within-macro.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/143-multiple-else.c [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/143-multiple-else.c.expected [new file with mode: 0644]
src/compiler/glsl/glcpp/tests/glcpp-test [new file with mode: 0755]
src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf [new file with mode: 0755]
src/compiler/glsl/glsl_lexer.ll [new file with mode: 0644]
src/compiler/glsl/glsl_parser.yy [new file with mode: 0644]
src/compiler/glsl/glsl_parser_extras.cpp [new file with mode: 0644]
src/compiler/glsl/glsl_parser_extras.h [new file with mode: 0644]
src/compiler/glsl/glsl_symbol_table.cpp [new file with mode: 0644]
src/compiler/glsl/glsl_symbol_table.h [new file with mode: 0644]
src/compiler/glsl/hir_field_selection.cpp [new file with mode: 0644]
src/compiler/glsl/ir.cpp [new file with mode: 0644]
src/compiler/glsl/ir.h [new file with mode: 0644]
src/compiler/glsl/ir_basic_block.cpp [new file with mode: 0644]
src/compiler/glsl/ir_basic_block.h [new file with mode: 0644]
src/compiler/glsl/ir_builder.cpp [new file with mode: 0644]
src/compiler/glsl/ir_builder.h [new file with mode: 0644]
src/compiler/glsl/ir_clone.cpp [new file with mode: 0644]
src/compiler/glsl/ir_constant_expression.cpp [new file with mode: 0644]
src/compiler/glsl/ir_equals.cpp [new file with mode: 0644]
src/compiler/glsl/ir_expression_flattening.cpp [new file with mode: 0644]
src/compiler/glsl/ir_expression_flattening.h [new file with mode: 0644]
src/compiler/glsl/ir_function.cpp [new file with mode: 0644]
src/compiler/glsl/ir_function_can_inline.cpp [new file with mode: 0644]
src/compiler/glsl/ir_function_detect_recursion.cpp [new file with mode: 0644]
src/compiler/glsl/ir_function_inlining.h [new file with mode: 0644]
src/compiler/glsl/ir_hierarchical_visitor.cpp [new file with mode: 0644]
src/compiler/glsl/ir_hierarchical_visitor.h [new file with mode: 0644]
src/compiler/glsl/ir_hv_accept.cpp [new file with mode: 0644]
src/compiler/glsl/ir_import_prototypes.cpp [new file with mode: 0644]
src/compiler/glsl/ir_optimization.h [new file with mode: 0644]
src/compiler/glsl/ir_print_visitor.cpp [new file with mode: 0644]
src/compiler/glsl/ir_print_visitor.h [new file with mode: 0644]
src/compiler/glsl/ir_reader.cpp [new file with mode: 0644]
src/compiler/glsl/ir_reader.h [new file with mode: 0644]
src/compiler/glsl/ir_rvalue_visitor.cpp [new file with mode: 0644]
src/compiler/glsl/ir_rvalue_visitor.h [new file with mode: 0644]
src/compiler/glsl/ir_set_program_inouts.cpp [new file with mode: 0644]
src/compiler/glsl/ir_uniform.h [new file with mode: 0644]
src/compiler/glsl/ir_validate.cpp [new file with mode: 0644]
src/compiler/glsl/ir_variable_refcount.cpp [new file with mode: 0644]
src/compiler/glsl/ir_variable_refcount.h [new file with mode: 0644]
src/compiler/glsl/ir_visitor.h [new file with mode: 0644]
src/compiler/glsl/link_atomics.cpp [new file with mode: 0644]
src/compiler/glsl/link_functions.cpp [new file with mode: 0644]
src/compiler/glsl/link_interface_blocks.cpp [new file with mode: 0644]
src/compiler/glsl/link_uniform_block_active_visitor.cpp [new file with mode: 0644]
src/compiler/glsl/link_uniform_block_active_visitor.h [new file with mode: 0644]
src/compiler/glsl/link_uniform_blocks.cpp [new file with mode: 0644]
src/compiler/glsl/link_uniform_initializers.cpp [new file with mode: 0644]
src/compiler/glsl/link_uniforms.cpp [new file with mode: 0644]
src/compiler/glsl/link_varyings.cpp [new file with mode: 0644]
src/compiler/glsl/link_varyings.h [new file with mode: 0644]
src/compiler/glsl/linker.cpp [new file with mode: 0644]
src/compiler/glsl/linker.h [new file with mode: 0644]
src/compiler/glsl/list.h [new file with mode: 0644]
src/compiler/glsl/loop_analysis.cpp [new file with mode: 0644]
src/compiler/glsl/loop_analysis.h [new file with mode: 0644]
src/compiler/glsl/loop_controls.cpp [new file with mode: 0644]
src/compiler/glsl/loop_unroll.cpp [new file with mode: 0644]
src/compiler/glsl/lower_buffer_access.cpp [new file with mode: 0644]
src/compiler/glsl/lower_buffer_access.h [new file with mode: 0644]
src/compiler/glsl/lower_clip_distance.cpp [new file with mode: 0644]
src/compiler/glsl/lower_const_arrays_to_uniforms.cpp [new file with mode: 0644]
src/compiler/glsl/lower_discard.cpp [new file with mode: 0644]
src/compiler/glsl/lower_discard_flow.cpp [new file with mode: 0644]
src/compiler/glsl/lower_if_to_cond_assign.cpp [new file with mode: 0644]
src/compiler/glsl/lower_instructions.cpp [new file with mode: 0644]
src/compiler/glsl/lower_jumps.cpp [new file with mode: 0644]
src/compiler/glsl/lower_mat_op_to_vec.cpp [new file with mode: 0644]
src/compiler/glsl/lower_named_interface_blocks.cpp [new file with mode: 0644]
src/compiler/glsl/lower_noise.cpp [new file with mode: 0644]
src/compiler/glsl/lower_offset_array.cpp [new file with mode: 0644]
src/compiler/glsl/lower_output_reads.cpp [new file with mode: 0644]
src/compiler/glsl/lower_packed_varyings.cpp [new file with mode: 0644]
src/compiler/glsl/lower_packing_builtins.cpp [new file with mode: 0644]
src/compiler/glsl/lower_shared_reference.cpp [new file with mode: 0644]
src/compiler/glsl/lower_subroutine.cpp [new file with mode: 0644]
src/compiler/glsl/lower_tess_level.cpp [new file with mode: 0644]
src/compiler/glsl/lower_texture_projection.cpp [new file with mode: 0644]
src/compiler/glsl/lower_ubo_reference.cpp [new file with mode: 0644]
src/compiler/glsl/lower_variable_index_to_cond_assign.cpp [new file with mode: 0644]
src/compiler/glsl/lower_vec_index_to_cond_assign.cpp [new file with mode: 0644]
src/compiler/glsl/lower_vec_index_to_swizzle.cpp [new file with mode: 0644]
src/compiler/glsl/lower_vector.cpp [new file with mode: 0644]
src/compiler/glsl/lower_vector_derefs.cpp [new file with mode: 0644]
src/compiler/glsl/lower_vector_insert.cpp [new file with mode: 0644]
src/compiler/glsl/lower_vertex_id.cpp [new file with mode: 0644]
src/compiler/glsl/main.cpp [new file with mode: 0644]
src/compiler/glsl/opt_algebraic.cpp [new file with mode: 0644]
src/compiler/glsl/opt_array_splitting.cpp [new file with mode: 0644]
src/compiler/glsl/opt_conditional_discard.cpp [new file with mode: 0644]
src/compiler/glsl/opt_constant_folding.cpp [new file with mode: 0644]
src/compiler/glsl/opt_constant_propagation.cpp [new file with mode: 0644]
src/compiler/glsl/opt_constant_variable.cpp [new file with mode: 0644]
src/compiler/glsl/opt_copy_propagation.cpp [new file with mode: 0644]
src/compiler/glsl/opt_copy_propagation_elements.cpp [new file with mode: 0644]
src/compiler/glsl/opt_dead_builtin_variables.cpp [new file with mode: 0644]
src/compiler/glsl/opt_dead_builtin_varyings.cpp [new file with mode: 0644]
src/compiler/glsl/opt_dead_code.cpp [new file with mode: 0644]
src/compiler/glsl/opt_dead_code_local.cpp [new file with mode: 0644]
src/compiler/glsl/opt_dead_functions.cpp [new file with mode: 0644]
src/compiler/glsl/opt_flatten_nested_if_blocks.cpp [new file with mode: 0644]
src/compiler/glsl/opt_flip_matrices.cpp [new file with mode: 0644]
src/compiler/glsl/opt_function_inlining.cpp [new file with mode: 0644]
src/compiler/glsl/opt_if_simplification.cpp [new file with mode: 0644]
src/compiler/glsl/opt_minmax.cpp [new file with mode: 0644]
src/compiler/glsl/opt_noop_swizzle.cpp [new file with mode: 0644]
src/compiler/glsl/opt_rebalance_tree.cpp [new file with mode: 0644]
src/compiler/glsl/opt_redundant_jumps.cpp [new file with mode: 0644]
src/compiler/glsl/opt_structure_splitting.cpp [new file with mode: 0644]
src/compiler/glsl/opt_swizzle_swizzle.cpp [new file with mode: 0644]
src/compiler/glsl/opt_tree_grafting.cpp [new file with mode: 0644]
src/compiler/glsl/opt_vectorize.cpp [new file with mode: 0644]
src/compiler/glsl/program.h [new file with mode: 0644]
src/compiler/glsl/s_expression.cpp [new file with mode: 0644]
src/compiler/glsl/s_expression.h [new file with mode: 0644]
src/compiler/glsl/standalone_scaffolding.cpp [new file with mode: 0644]
src/compiler/glsl/standalone_scaffolding.h [new file with mode: 0644]
src/compiler/glsl/test.cpp [new file with mode: 0644]
src/compiler/glsl/test_optpass.cpp [new file with mode: 0644]
src/compiler/glsl/test_optpass.h [new file with mode: 0644]
src/compiler/glsl/tests/.gitignore [new file with mode: 0644]
src/compiler/glsl/tests/blob_test.c [new file with mode: 0644]
src/compiler/glsl/tests/builtin_variable_test.cpp [new file with mode: 0644]
src/compiler/glsl/tests/compare_ir [new file with mode: 0755]
src/compiler/glsl/tests/copy_constant_to_storage_tests.cpp [new file with mode: 0644]
src/compiler/glsl/tests/general_ir_test.cpp [new file with mode: 0644]
src/compiler/glsl/tests/invalidate_locations_test.cpp [new file with mode: 0644]
src/compiler/glsl/tests/lower_jumps/.gitignore [new file with mode: 0644]
src/compiler/glsl/tests/lower_jumps/create_test_cases.py [new file with mode: 0644]
src/compiler/glsl/tests/optimization-test [new file with mode: 0755]
src/compiler/glsl/tests/sampler_types_test.cpp [new file with mode: 0644]
src/compiler/glsl/tests/set_uniform_initializer_tests.cpp [new file with mode: 0644]
src/compiler/glsl/tests/sexps.py [new file with mode: 0644]
src/compiler/glsl/tests/uniform_initializer_utils.cpp [new file with mode: 0644]
src/compiler/glsl/tests/uniform_initializer_utils.h [new file with mode: 0644]
src/compiler/glsl/tests/varyings_test.cpp [new file with mode: 0644]
src/compiler/glsl_types.cpp
src/compiler/nir/Makefile.sources [new file with mode: 0644]
src/compiler/nir/glsl_to_nir.cpp
src/compiler/nir/glsl_to_nir.h
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_atomics.c
src/compiler/nir/nir_lower_samplers.c
src/compiler/nir_types.cpp
src/gallium/auxiliary/nir/tgsi_to_nir.c
src/glsl/.gitignore [deleted file]
src/glsl/Android.gen.mk [deleted file]
src/glsl/Android.mk [deleted file]
src/glsl/Makefile.am [deleted file]
src/glsl/Makefile.sources [deleted file]
src/glsl/README [deleted file]
src/glsl/SConscript [deleted file]
src/glsl/TODO [deleted file]
src/glsl/ast.h [deleted file]
src/glsl/ast_array_index.cpp [deleted file]
src/glsl/ast_expr.cpp [deleted file]
src/glsl/ast_function.cpp [deleted file]
src/glsl/ast_to_hir.cpp [deleted file]
src/glsl/ast_type.cpp [deleted file]
src/glsl/blob.c [deleted file]
src/glsl/blob.h [deleted file]
src/glsl/builtin_functions.cpp [deleted file]
src/glsl/builtin_types.cpp [deleted file]
src/glsl/builtin_variables.cpp [deleted file]
src/glsl/glcpp/.gitignore [deleted file]
src/glsl/glcpp/README [deleted file]
src/glsl/glcpp/glcpp-lex.l [deleted file]
src/glsl/glcpp/glcpp-parse.y [deleted file]
src/glsl/glcpp/glcpp.c [deleted file]
src/glsl/glcpp/glcpp.h [deleted file]
src/glsl/glcpp/pp.c [deleted file]
src/glsl/glcpp/tests/.gitignore [deleted file]
src/glsl/glcpp/tests/000-content-with-spaces.c [deleted file]
src/glsl/glcpp/tests/000-content-with-spaces.c.expected [deleted file]
src/glsl/glcpp/tests/001-define.c [deleted file]
src/glsl/glcpp/tests/001-define.c.expected [deleted file]
src/glsl/glcpp/tests/002-define-chain.c [deleted file]
src/glsl/glcpp/tests/002-define-chain.c.expected [deleted file]
src/glsl/glcpp/tests/003-define-chain-reverse.c [deleted file]
src/glsl/glcpp/tests/003-define-chain-reverse.c.expected [deleted file]
src/glsl/glcpp/tests/004-define-recursive.c [deleted file]
src/glsl/glcpp/tests/004-define-recursive.c.expected [deleted file]
src/glsl/glcpp/tests/005-define-composite-chain.c [deleted file]
src/glsl/glcpp/tests/005-define-composite-chain.c.expected [deleted file]
src/glsl/glcpp/tests/006-define-composite-chain-reverse.c [deleted file]
src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected [deleted file]
src/glsl/glcpp/tests/007-define-composite-recursive.c [deleted file]
src/glsl/glcpp/tests/007-define-composite-recursive.c.expected [deleted file]
src/glsl/glcpp/tests/008-define-empty.c [deleted file]
src/glsl/glcpp/tests/008-define-empty.c.expected [deleted file]
src/glsl/glcpp/tests/009-undef.c [deleted file]
src/glsl/glcpp/tests/009-undef.c.expected [deleted file]
src/glsl/glcpp/tests/010-undef-re-define.c [deleted file]
src/glsl/glcpp/tests/010-undef-re-define.c.expected [deleted file]
src/glsl/glcpp/tests/011-define-func-empty.c [deleted file]
src/glsl/glcpp/tests/011-define-func-empty.c.expected [deleted file]
src/glsl/glcpp/tests/012-define-func-no-args.c [deleted file]
src/glsl/glcpp/tests/012-define-func-no-args.c.expected [deleted file]
src/glsl/glcpp/tests/013-define-func-1-arg-unused.c [deleted file]
src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected [deleted file]
src/glsl/glcpp/tests/014-define-func-2-arg-unused.c [deleted file]
src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected [deleted file]
src/glsl/glcpp/tests/015-define-object-with-parens.c [deleted file]
src/glsl/glcpp/tests/015-define-object-with-parens.c.expected [deleted file]
src/glsl/glcpp/tests/016-define-func-1-arg.c [deleted file]
src/glsl/glcpp/tests/016-define-func-1-arg.c.expected [deleted file]
src/glsl/glcpp/tests/017-define-func-2-args.c [deleted file]
src/glsl/glcpp/tests/017-define-func-2-args.c.expected [deleted file]
src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c [deleted file]
src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected [deleted file]
src/glsl/glcpp/tests/019-define-func-1-arg-multi.c [deleted file]
src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected [deleted file]
src/glsl/glcpp/tests/020-define-func-2-arg-multi.c [deleted file]
src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected [deleted file]
src/glsl/glcpp/tests/021-define-func-compose.c [deleted file]
src/glsl/glcpp/tests/021-define-func-compose.c.expected [deleted file]
src/glsl/glcpp/tests/022-define-func-arg-with-parens.c [deleted file]
src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected [deleted file]
src/glsl/glcpp/tests/023-define-extra-whitespace.c [deleted file]
src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected [deleted file]
src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c [deleted file]
src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected [deleted file]
src/glsl/glcpp/tests/025-func-macro-as-non-macro.c [deleted file]
src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected [deleted file]
src/glsl/glcpp/tests/026-define-func-extra-newlines.c [deleted file]
src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected [deleted file]
src/glsl/glcpp/tests/027-define-chain-obj-to-func.c [deleted file]
src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected [deleted file]
src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c [deleted file]
src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected [deleted file]
src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c [deleted file]
src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected [deleted file]
src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c [deleted file]
src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected [deleted file]
src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c [deleted file]
src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected [deleted file]
src/glsl/glcpp/tests/032-define-func-self-recurse.c [deleted file]
src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected [deleted file]
src/glsl/glcpp/tests/033-define-func-self-compose.c [deleted file]
src/glsl/glcpp/tests/033-define-func-self-compose.c.expected [deleted file]
src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c [deleted file]
src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected [deleted file]
src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c [deleted file]
src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected [deleted file]
src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c [deleted file]
src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected [deleted file]
src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c [deleted file]
src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected [deleted file]
src/glsl/glcpp/tests/038-func-arg-with-commas.c [deleted file]
src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected [deleted file]
src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c [deleted file]
src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected [deleted file]
src/glsl/glcpp/tests/040-token-pasting.c [deleted file]
src/glsl/glcpp/tests/040-token-pasting.c.expected [deleted file]
src/glsl/glcpp/tests/041-if-0.c [deleted file]
src/glsl/glcpp/tests/041-if-0.c.expected [deleted file]
src/glsl/glcpp/tests/042-if-1.c [deleted file]
src/glsl/glcpp/tests/042-if-1.c.expected [deleted file]
src/glsl/glcpp/tests/043-if-0-else.c [deleted file]
src/glsl/glcpp/tests/043-if-0-else.c.expected [deleted file]
src/glsl/glcpp/tests/044-if-1-else.c [deleted file]
src/glsl/glcpp/tests/044-if-1-else.c.expected [deleted file]
src/glsl/glcpp/tests/045-if-0-elif.c [deleted file]
src/glsl/glcpp/tests/045-if-0-elif.c.expected [deleted file]
src/glsl/glcpp/tests/046-if-1-elsif.c [deleted file]
src/glsl/glcpp/tests/046-if-1-elsif.c.expected [deleted file]
src/glsl/glcpp/tests/047-if-elif-else.c [deleted file]
src/glsl/glcpp/tests/047-if-elif-else.c.expected [deleted file]
src/glsl/glcpp/tests/048-if-nested.c [deleted file]
src/glsl/glcpp/tests/048-if-nested.c.expected [deleted file]
src/glsl/glcpp/tests/049-if-expression-precedence.c [deleted file]
src/glsl/glcpp/tests/049-if-expression-precedence.c.expected [deleted file]
src/glsl/glcpp/tests/050-if-defined.c [deleted file]
src/glsl/glcpp/tests/050-if-defined.c.expected [deleted file]
src/glsl/glcpp/tests/051-if-relational.c [deleted file]
src/glsl/glcpp/tests/051-if-relational.c.expected [deleted file]
src/glsl/glcpp/tests/052-if-bitwise.c [deleted file]
src/glsl/glcpp/tests/052-if-bitwise.c.expected [deleted file]
src/glsl/glcpp/tests/053-if-divide-and-shift.c [deleted file]
src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected [deleted file]
src/glsl/glcpp/tests/054-if-with-macros.c [deleted file]
src/glsl/glcpp/tests/054-if-with-macros.c.expected [deleted file]
src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c [deleted file]
src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected [deleted file]
src/glsl/glcpp/tests/056-macro-argument-with-comma.c [deleted file]
src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected [deleted file]
src/glsl/glcpp/tests/057-empty-arguments.c [deleted file]
src/glsl/glcpp/tests/057-empty-arguments.c.expected [deleted file]
src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c [deleted file]
src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected [deleted file]
src/glsl/glcpp/tests/059-token-pasting-integer.c [deleted file]
src/glsl/glcpp/tests/059-token-pasting-integer.c.expected [deleted file]
src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c [deleted file]
src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected [deleted file]
src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c [deleted file]
src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected [deleted file]
src/glsl/glcpp/tests/062-if-0-skips-garbage.c [deleted file]
src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected [deleted file]
src/glsl/glcpp/tests/063-comments.c [deleted file]
src/glsl/glcpp/tests/063-comments.c.expected [deleted file]
src/glsl/glcpp/tests/064-version.c [deleted file]
src/glsl/glcpp/tests/064-version.c.expected [deleted file]
src/glsl/glcpp/tests/065-if-defined-parens.c [deleted file]
src/glsl/glcpp/tests/065-if-defined-parens.c.expected [deleted file]
src/glsl/glcpp/tests/066-if-nospace-expression.c [deleted file]
src/glsl/glcpp/tests/066-if-nospace-expression.c.expected [deleted file]
src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c [deleted file]
src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected [deleted file]
src/glsl/glcpp/tests/068-accidental-pasting.c [deleted file]
src/glsl/glcpp/tests/068-accidental-pasting.c.expected [deleted file]
src/glsl/glcpp/tests/069-repeated-argument.c [deleted file]
src/glsl/glcpp/tests/069-repeated-argument.c.expected [deleted file]
src/glsl/glcpp/tests/070-undefined-macro-in-expression.c [deleted file]
src/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected [deleted file]
src/glsl/glcpp/tests/071-punctuator.c [deleted file]
src/glsl/glcpp/tests/071-punctuator.c.expected [deleted file]
src/glsl/glcpp/tests/072-token-pasting-same-line.c [deleted file]
src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected [deleted file]
src/glsl/glcpp/tests/073-if-in-ifdef.c [deleted file]
src/glsl/glcpp/tests/073-if-in-ifdef.c.expected [deleted file]
src/glsl/glcpp/tests/074-elif-undef.c [deleted file]
src/glsl/glcpp/tests/074-elif-undef.c.expected [deleted file]
src/glsl/glcpp/tests/075-elif-elif-undef.c [deleted file]
src/glsl/glcpp/tests/075-elif-elif-undef.c.expected [deleted file]
src/glsl/glcpp/tests/076-elif-undef-nested.c [deleted file]
src/glsl/glcpp/tests/076-elif-undef-nested.c.expected [deleted file]
src/glsl/glcpp/tests/077-else-without-if.c [deleted file]
src/glsl/glcpp/tests/077-else-without-if.c.expected [deleted file]
src/glsl/glcpp/tests/078-elif-without-if.c [deleted file]
src/glsl/glcpp/tests/078-elif-without-if.c.expected [deleted file]
src/glsl/glcpp/tests/079-endif-without-if.c [deleted file]
src/glsl/glcpp/tests/079-endif-without-if.c.expected [deleted file]
src/glsl/glcpp/tests/080-if-without-expression.c [deleted file]
src/glsl/glcpp/tests/080-if-without-expression.c.expected [deleted file]
src/glsl/glcpp/tests/081-elif-without-expression.c [deleted file]
src/glsl/glcpp/tests/081-elif-without-expression.c.expected [deleted file]
src/glsl/glcpp/tests/082-invalid-paste.c [deleted file]
src/glsl/glcpp/tests/082-invalid-paste.c.expected [deleted file]
src/glsl/glcpp/tests/083-unterminated-if.c [deleted file]
src/glsl/glcpp/tests/083-unterminated-if.c.expected [deleted file]
src/glsl/glcpp/tests/084-unbalanced-parentheses.c [deleted file]
src/glsl/glcpp/tests/084-unbalanced-parentheses.c.expected [deleted file]
src/glsl/glcpp/tests/085-incorrect-argument-count.c [deleted file]
src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected [deleted file]
src/glsl/glcpp/tests/086-reserved-macro-names.c [deleted file]
src/glsl/glcpp/tests/086-reserved-macro-names.c.expected [deleted file]
src/glsl/glcpp/tests/087-if-comments.c [deleted file]
src/glsl/glcpp/tests/087-if-comments.c.expected [deleted file]
src/glsl/glcpp/tests/088-redefine-macro-legitimate.c [deleted file]
src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected [deleted file]
src/glsl/glcpp/tests/089-redefine-macro-error.c [deleted file]
src/glsl/glcpp/tests/089-redefine-macro-error.c.expected [deleted file]
src/glsl/glcpp/tests/090-hash-error.c [deleted file]
src/glsl/glcpp/tests/090-hash-error.c.expected [deleted file]
src/glsl/glcpp/tests/091-hash-line.c [deleted file]
src/glsl/glcpp/tests/091-hash-line.c.expected [deleted file]
src/glsl/glcpp/tests/092-redefine-macro-error-2.c [deleted file]
src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected [deleted file]
src/glsl/glcpp/tests/093-divide-by-zero.c [deleted file]
src/glsl/glcpp/tests/093-divide-by-zero.c.expected [deleted file]
src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c [deleted file]
src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c.expected [deleted file]
src/glsl/glcpp/tests/095-recursive-define.c [deleted file]
src/glsl/glcpp/tests/095-recursive-define.c.expected [deleted file]
src/glsl/glcpp/tests/096-paste-twice.c [deleted file]
src/glsl/glcpp/tests/096-paste-twice.c.expected [deleted file]
src/glsl/glcpp/tests/097-paste-with-non-function-macro.c [deleted file]
src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected [deleted file]
src/glsl/glcpp/tests/098-elif-undefined.c [deleted file]
src/glsl/glcpp/tests/098-elif-undefined.c.expected [deleted file]
src/glsl/glcpp/tests/099-c99-example.c [deleted file]
src/glsl/glcpp/tests/099-c99-example.c.expected [deleted file]
src/glsl/glcpp/tests/100-macro-with-colon.c [deleted file]
src/glsl/glcpp/tests/100-macro-with-colon.c.expected [deleted file]
src/glsl/glcpp/tests/101-macros-used-twice.c [deleted file]
src/glsl/glcpp/tests/101-macros-used-twice.c.expected [deleted file]
src/glsl/glcpp/tests/102-garbage-after-endif.c [deleted file]
src/glsl/glcpp/tests/102-garbage-after-endif.c.expected [deleted file]
src/glsl/glcpp/tests/103-garbage-after-else-0.c [deleted file]
src/glsl/glcpp/tests/103-garbage-after-else-0.c.expected [deleted file]
src/glsl/glcpp/tests/104-hash-line-followed-by-code.c [deleted file]
src/glsl/glcpp/tests/104-hash-line-followed-by-code.c.expected [deleted file]
src/glsl/glcpp/tests/105-multiline-hash-line.c [deleted file]
src/glsl/glcpp/tests/105-multiline-hash-line.c.expected [deleted file]
src/glsl/glcpp/tests/106-multiline-hash-if.c [deleted file]
src/glsl/glcpp/tests/106-multiline-hash-if.c.expected [deleted file]
src/glsl/glcpp/tests/107-multiline-hash-elif.c [deleted file]
src/glsl/glcpp/tests/107-multiline-hash-elif.c.expected [deleted file]
src/glsl/glcpp/tests/108-no-space-after-hash-version.c [deleted file]
src/glsl/glcpp/tests/108-no-space-after-hash-version.c.expected [deleted file]
src/glsl/glcpp/tests/109-no-space-after-hash-line.c [deleted file]
src/glsl/glcpp/tests/109-no-space-after-hash-line.c.expected [deleted file]
src/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c [deleted file]
src/glsl/glcpp/tests/110-no-space-digits-after-hash-elif.c.expected [deleted file]
src/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c [deleted file]
src/glsl/glcpp/tests/111-no-space-operator-after-hash-if.c.expected [deleted file]
src/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c [deleted file]
src/glsl/glcpp/tests/112-no-space-operator-after-hash-elif.c.expected [deleted file]
src/glsl/glcpp/tests/113-line-and-file-macros.c [deleted file]
src/glsl/glcpp/tests/113-line-and-file-macros.c.expected [deleted file]
src/glsl/glcpp/tests/114-paste-integer-tokens.c [deleted file]
src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected [deleted file]
src/glsl/glcpp/tests/115-line-continuations.c [deleted file]
src/glsl/glcpp/tests/115-line-continuations.c.expected [deleted file]
src/glsl/glcpp/tests/116-disable-line-continuations.c [deleted file]
src/glsl/glcpp/tests/116-disable-line-continuations.c.expected [deleted file]
src/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c [deleted file]
src/glsl/glcpp/tests/117-line-continuation-and-non-continuation-backslash.c.expected [deleted file]
src/glsl/glcpp/tests/118-comment-becomes-space.c [deleted file]
src/glsl/glcpp/tests/118-comment-becomes-space.c.expected [deleted file]
src/glsl/glcpp/tests/119-elif-after-else.c [deleted file]
src/glsl/glcpp/tests/119-elif-after-else.c.expected [deleted file]
src/glsl/glcpp/tests/120-undef-builtin.c [deleted file]
src/glsl/glcpp/tests/120-undef-builtin.c.expected [deleted file]
src/glsl/glcpp/tests/121-comment-bug-72686.c [deleted file]
src/glsl/glcpp/tests/121-comment-bug-72686.c.expected [deleted file]
src/glsl/glcpp/tests/122-redefine-whitespace.c [deleted file]
src/glsl/glcpp/tests/122-redefine-whitespace.c.expected [deleted file]
src/glsl/glcpp/tests/123-garbage-after-else-1.c [deleted file]
src/glsl/glcpp/tests/123-garbage-after-else-1.c.expected [deleted file]
src/glsl/glcpp/tests/124-preprocessing-numbers.c [deleted file]
src/glsl/glcpp/tests/124-preprocessing-numbers.c.expected [deleted file]
src/glsl/glcpp/tests/125-es-short-circuit-undefined.c [deleted file]
src/glsl/glcpp/tests/125-es-short-circuit-undefined.c.expected [deleted file]
src/glsl/glcpp/tests/126-garbage-after-directive.c [deleted file]
src/glsl/glcpp/tests/126-garbage-after-directive.c.expected [deleted file]
src/glsl/glcpp/tests/127-pragma-empty.c [deleted file]
src/glsl/glcpp/tests/127-pragma-empty.c.expected [deleted file]
src/glsl/glcpp/tests/128-space-before-hash.c [deleted file]
src/glsl/glcpp/tests/128-space-before-hash.c.expected [deleted file]
src/glsl/glcpp/tests/129-define-non-identifier.c [deleted file]
src/glsl/glcpp/tests/129-define-non-identifier.c.expected [deleted file]
src/glsl/glcpp/tests/130-define-comment.c [deleted file]
src/glsl/glcpp/tests/130-define-comment.c.expected [deleted file]
src/glsl/glcpp/tests/131-eof-without-newline.c [deleted file]
src/glsl/glcpp/tests/131-eof-without-newline.c.expected [deleted file]
src/glsl/glcpp/tests/132-eof-without-newline-define.c [deleted file]
src/glsl/glcpp/tests/132-eof-without-newline-define.c.expected [deleted file]
src/glsl/glcpp/tests/133-eof-without-newline-comment.c [deleted file]
src/glsl/glcpp/tests/133-eof-without-newline-comment.c.expected [deleted file]
src/glsl/glcpp/tests/134-hash-comment-directive.c [deleted file]
src/glsl/glcpp/tests/134-hash-comment-directive.c.expected [deleted file]
src/glsl/glcpp/tests/135-duplicate-parameter.c [deleted file]
src/glsl/glcpp/tests/135-duplicate-parameter.c.expected [deleted file]
src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c [deleted file]
src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected [deleted file]
src/glsl/glcpp/tests/137-expand-macro-after-period.c [deleted file]
src/glsl/glcpp/tests/137-expand-macro-after-period.c.expected [deleted file]
src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c [deleted file]
src/glsl/glcpp/tests/138-multi-line-comment-in-if-0.c.expected [deleted file]
src/glsl/glcpp/tests/139-define-without-macro-name.c [deleted file]
src/glsl/glcpp/tests/139-define-without-macro-name.c.expected [deleted file]
src/glsl/glcpp/tests/140-null-directive.c [deleted file]
src/glsl/glcpp/tests/140-null-directive.c.expected [deleted file]
src/glsl/glcpp/tests/141-pragma-and-__LINE__.c [deleted file]
src/glsl/glcpp/tests/141-pragma-and-__LINE__.c.expected [deleted file]
src/glsl/glcpp/tests/142-defined-within-macro.c [deleted file]
src/glsl/glcpp/tests/142-defined-within-macro.c.expected [deleted file]
src/glsl/glcpp/tests/143-multiple-else.c [deleted file]
src/glsl/glcpp/tests/143-multiple-else.c.expected [deleted file]
src/glsl/glcpp/tests/glcpp-test [deleted file]
src/glsl/glcpp/tests/glcpp-test-cr-lf [deleted file]
src/glsl/glsl_lexer.ll [deleted file]
src/glsl/glsl_parser.yy [deleted file]
src/glsl/glsl_parser_extras.cpp [deleted file]
src/glsl/glsl_parser_extras.h [deleted file]
src/glsl/glsl_symbol_table.cpp [deleted file]
src/glsl/glsl_symbol_table.h [deleted file]
src/glsl/hir_field_selection.cpp [deleted file]
src/glsl/ir.cpp [deleted file]
src/glsl/ir.h [deleted file]
src/glsl/ir_basic_block.cpp [deleted file]
src/glsl/ir_basic_block.h [deleted file]
src/glsl/ir_builder.cpp [deleted file]
src/glsl/ir_builder.h [deleted file]
src/glsl/ir_clone.cpp [deleted file]
src/glsl/ir_constant_expression.cpp [deleted file]
src/glsl/ir_equals.cpp [deleted file]
src/glsl/ir_expression_flattening.cpp [deleted file]
src/glsl/ir_expression_flattening.h [deleted file]
src/glsl/ir_function.cpp [deleted file]
src/glsl/ir_function_can_inline.cpp [deleted file]
src/glsl/ir_function_detect_recursion.cpp [deleted file]
src/glsl/ir_function_inlining.h [deleted file]
src/glsl/ir_hierarchical_visitor.cpp [deleted file]
src/glsl/ir_hierarchical_visitor.h [deleted file]
src/glsl/ir_hv_accept.cpp [deleted file]
src/glsl/ir_import_prototypes.cpp [deleted file]
src/glsl/ir_optimization.h [deleted file]
src/glsl/ir_print_visitor.cpp [deleted file]
src/glsl/ir_print_visitor.h [deleted file]
src/glsl/ir_reader.cpp [deleted file]
src/glsl/ir_reader.h [deleted file]
src/glsl/ir_rvalue_visitor.cpp [deleted file]
src/glsl/ir_rvalue_visitor.h [deleted file]
src/glsl/ir_set_program_inouts.cpp [deleted file]
src/glsl/ir_uniform.h [deleted file]
src/glsl/ir_validate.cpp [deleted file]
src/glsl/ir_variable_refcount.cpp [deleted file]
src/glsl/ir_variable_refcount.h [deleted file]
src/glsl/ir_visitor.h [deleted file]
src/glsl/link_atomics.cpp [deleted file]
src/glsl/link_functions.cpp [deleted file]
src/glsl/link_interface_blocks.cpp [deleted file]
src/glsl/link_uniform_block_active_visitor.cpp [deleted file]
src/glsl/link_uniform_block_active_visitor.h [deleted file]
src/glsl/link_uniform_blocks.cpp [deleted file]
src/glsl/link_uniform_initializers.cpp [deleted file]
src/glsl/link_uniforms.cpp [deleted file]
src/glsl/link_varyings.cpp [deleted file]
src/glsl/link_varyings.h [deleted file]
src/glsl/linker.cpp [deleted file]
src/glsl/linker.h [deleted file]
src/glsl/list.h [deleted file]
src/glsl/loop_analysis.cpp [deleted file]
src/glsl/loop_analysis.h [deleted file]
src/glsl/loop_controls.cpp [deleted file]
src/glsl/loop_unroll.cpp [deleted file]
src/glsl/lower_buffer_access.cpp [deleted file]
src/glsl/lower_buffer_access.h [deleted file]
src/glsl/lower_clip_distance.cpp [deleted file]
src/glsl/lower_const_arrays_to_uniforms.cpp [deleted file]
src/glsl/lower_discard.cpp [deleted file]
src/glsl/lower_discard_flow.cpp [deleted file]
src/glsl/lower_if_to_cond_assign.cpp [deleted file]
src/glsl/lower_instructions.cpp [deleted file]
src/glsl/lower_jumps.cpp [deleted file]
src/glsl/lower_mat_op_to_vec.cpp [deleted file]
src/glsl/lower_named_interface_blocks.cpp [deleted file]
src/glsl/lower_noise.cpp [deleted file]
src/glsl/lower_offset_array.cpp [deleted file]
src/glsl/lower_output_reads.cpp [deleted file]
src/glsl/lower_packed_varyings.cpp [deleted file]
src/glsl/lower_packing_builtins.cpp [deleted file]
src/glsl/lower_shared_reference.cpp [deleted file]
src/glsl/lower_subroutine.cpp [deleted file]
src/glsl/lower_tess_level.cpp [deleted file]
src/glsl/lower_texture_projection.cpp [deleted file]
src/glsl/lower_ubo_reference.cpp [deleted file]
src/glsl/lower_variable_index_to_cond_assign.cpp [deleted file]
src/glsl/lower_vec_index_to_cond_assign.cpp [deleted file]
src/glsl/lower_vec_index_to_swizzle.cpp [deleted file]
src/glsl/lower_vector.cpp [deleted file]
src/glsl/lower_vector_derefs.cpp [deleted file]
src/glsl/lower_vector_insert.cpp [deleted file]
src/glsl/lower_vertex_id.cpp [deleted file]
src/glsl/main.cpp [deleted file]
src/glsl/opt_algebraic.cpp [deleted file]
src/glsl/opt_array_splitting.cpp [deleted file]
src/glsl/opt_conditional_discard.cpp [deleted file]
src/glsl/opt_constant_folding.cpp [deleted file]
src/glsl/opt_constant_propagation.cpp [deleted file]
src/glsl/opt_constant_variable.cpp [deleted file]
src/glsl/opt_copy_propagation.cpp [deleted file]
src/glsl/opt_copy_propagation_elements.cpp [deleted file]
src/glsl/opt_dead_builtin_variables.cpp [deleted file]
src/glsl/opt_dead_builtin_varyings.cpp [deleted file]
src/glsl/opt_dead_code.cpp [deleted file]
src/glsl/opt_dead_code_local.cpp [deleted file]
src/glsl/opt_dead_functions.cpp [deleted file]
src/glsl/opt_flatten_nested_if_blocks.cpp [deleted file]
src/glsl/opt_flip_matrices.cpp [deleted file]
src/glsl/opt_function_inlining.cpp [deleted file]
src/glsl/opt_if_simplification.cpp [deleted file]
src/glsl/opt_minmax.cpp [deleted file]
src/glsl/opt_noop_swizzle.cpp [deleted file]
src/glsl/opt_rebalance_tree.cpp [deleted file]
src/glsl/opt_redundant_jumps.cpp [deleted file]
src/glsl/opt_structure_splitting.cpp [deleted file]
src/glsl/opt_swizzle_swizzle.cpp [deleted file]
src/glsl/opt_tree_grafting.cpp [deleted file]
src/glsl/opt_vectorize.cpp [deleted file]
src/glsl/program.h [deleted file]
src/glsl/s_expression.cpp [deleted file]
src/glsl/s_expression.h [deleted file]
src/glsl/standalone_scaffolding.cpp [deleted file]
src/glsl/standalone_scaffolding.h [deleted file]
src/glsl/test.cpp [deleted file]
src/glsl/test_optpass.cpp [deleted file]
src/glsl/test_optpass.h [deleted file]
src/glsl/tests/.gitignore [deleted file]
src/glsl/tests/blob_test.c [deleted file]
src/glsl/tests/builtin_variable_test.cpp [deleted file]
src/glsl/tests/compare_ir [deleted file]
src/glsl/tests/copy_constant_to_storage_tests.cpp [deleted file]
src/glsl/tests/general_ir_test.cpp [deleted file]
src/glsl/tests/invalidate_locations_test.cpp [deleted file]
src/glsl/tests/lower_jumps/.gitignore [deleted file]
src/glsl/tests/lower_jumps/create_test_cases.py [deleted file]
src/glsl/tests/optimization-test [deleted file]
src/glsl/tests/sampler_types_test.cpp [deleted file]
src/glsl/tests/set_uniform_initializer_tests.cpp [deleted file]
src/glsl/tests/sexps.py [deleted file]
src/glsl/tests/uniform_initializer_utils.cpp [deleted file]
src/glsl/tests/uniform_initializer_utils.h [deleted file]
src/glsl/tests/varyings_test.cpp [deleted file]
src/mesa/Makefile.am
src/mesa/Makefile.sources
src/mesa/drivers/dri/i965/brw_cs.c
src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_link.cpp
src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp
src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/gen7_cs_state.c
src/mesa/drivers/dri/i965/intel_resolve_map.h
src/mesa/main/context.c
src/mesa/main/ff_fragment_shader.cpp
src/mesa/main/pipelineobj.c
src/mesa/main/program_resource.c
src/mesa/main/shader_query.cpp
src/mesa/main/shaderapi.c
src/mesa/main/uniform_query.cpp
src/mesa/main/uniforms.c
src/mesa/main/uniforms.h
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/prog_to_nir.c
src/mesa/program/sampler.cpp
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index dc1e995b8d5d274ffe1d2f316753339565f3da7a..4172eaeefd9b9bf7384fb9d878c1da738b5339cd 100644 (file)
@@ -2506,7 +2506,6 @@ AC_CONFIG_FILES([Makefile
                src/gallium/winsys/virgl/vtest/Makefile
                src/gbm/Makefile
                src/gbm/main/gbm.pc
-               src/glsl/Makefile
                src/glx/Makefile
                src/glx/apple/Makefile
                src/glx/tests/Makefile
index a0ec40146b06e5d7b324ad93debf8694a7d8a028..9b23cf58f4ff96b0c555fa0d93b11a5952c459f3 100644 (file)
@@ -25,7 +25,7 @@ SUBDIRS = . gtest util mapi/glapi/gen mapi
 SUBDIRS += compiler
 
 if NEED_OPENGL_COMMON
-SUBDIRS += glsl mesa
+SUBDIRS += mesa
 endif
 
 SUBDIRS += loader
index 8acf9b04ab67d4cbdfad57b02dc151ee2a1c8575..4ba0a32d66925440b72e718547a4fe25334c7a27 100644 (file)
@@ -6,7 +6,6 @@ if env['platform'] == 'windows':
 
 SConscript('util/SConscript')
 SConscript('compiler/SConscript')
-SConscript('glsl/SConscript')
 
 if env['hostonly']:
     # We are just compiling the things necessary on the host for cross
index 1e3778df8d563d37d9cef4caa299ea08e17c6abd..0bc8e48efa64c35e8c71fb4c9e75250c89dafc67 100644 (file)
@@ -1,4 +1,5 @@
 #
+# Copyright © 2012 Jon TURNEY
 # Copyright (C) 2015 Intel Corporation
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -27,6 +28,9 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src \
        -I$(top_srcdir)/src/mapi \
        -I$(top_srcdir)/src/mesa/ \
+       -I$(top_builddir)/src/compiler/glsl\
+       -I$(top_srcdir)/src/compiler/glsl\
+       -I$(top_srcdir)/src/compiler/glsl/glcpp\
        -I$(top_srcdir)/src/gallium/include \
        -I$(top_srcdir)/src/gallium/auxiliary \
        -I$(top_srcdir)/src/gtest/include \
@@ -51,6 +55,201 @@ CLEANFILES =
 EXTRA_DIST = SConscript
 
 
+EXTRA_DIST += glsl/tests glsl/glcpp/tests glsl/README  \
+       glsl/TODO glsl/glcpp/README                     \
+       glsl/glsl_lexer.ll                              \
+       glsl/glsl_parser.yy                             \
+       glsl/glcpp/glcpp-lex.l                          \
+       glsl/glcpp/glcpp-parse.y                        \
+       glsl/Makefile.sources                           \
+       glsl/SConscript
+
+TESTS += glsl/glcpp/tests/glcpp-test                   \
+       glsl/glcpp/tests/glcpp-test-cr-lf               \
+       glsl/tests/blob-test                            \
+       glsl/tests/general-ir-test                      \
+       glsl/tests/optimization-test                    \
+       glsl/tests/sampler-types-test                   \
+       glsl/tests/uniform-initializer-test
+
+TESTS_ENVIRONMENT= \
+       export PYTHON2=$(PYTHON2); \
+       export PYTHON_FLAGS=$(PYTHON_FLAGS);
+
+check_PROGRAMS +=                                      \
+       glsl/glcpp/glcpp                                \
+       glsl/glsl_test                                  \
+       glsl/tests/blob-test                            \
+       glsl/tests/general-ir-test                      \
+       glsl/tests/sampler-types-test                   \
+       glsl/tests/uniform-initializer-test
+
+noinst_PROGRAMS = glsl_compiler
+
+glsl_tests_blob_test_SOURCES =                         \
+       glsl/tests/blob_test.c
+glsl_tests_blob_test_LDADD =                           \
+       glsl/libglsl.la
+
+glsl_tests_general_ir_test_SOURCES =                   \
+       glsl/standalone_scaffolding.cpp                 \
+       glsl/tests/builtin_variable_test.cpp            \
+       glsl/tests/invalidate_locations_test.cpp        \
+       glsl/tests/general_ir_test.cpp                  \
+       glsl/tests/varyings_test.cpp
+glsl_tests_general_ir_test_CFLAGS =                    \
+       $(PTHREAD_CFLAGS)
+glsl_tests_general_ir_test_LDADD =                     \
+       $(top_builddir)/src/gtest/libgtest.la           \
+       glsl/libglsl.la         \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(PTHREAD_LIBS)
+
+glsl_tests_uniform_initializer_test_SOURCES =          \
+       glsl/tests/copy_constant_to_storage_tests.cpp   \
+       glsl/tests/set_uniform_initializer_tests.cpp    \
+       glsl/tests/uniform_initializer_utils.cpp        \
+       glsl/tests/uniform_initializer_utils.h
+glsl_tests_uniform_initializer_test_CFLAGS =           \
+       $(PTHREAD_CFLAGS)
+glsl_tests_uniform_initializer_test_LDADD =            \
+       $(top_builddir)/src/gtest/libgtest.la           \
+       glsl/libglsl.la         \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(PTHREAD_LIBS)
+
+glsl_tests_sampler_types_test_SOURCES =                        \
+       glsl/tests/sampler_types_test.cpp
+glsl_tests_sampler_types_test_CFLAGS =                 \
+       $(PTHREAD_CFLAGS)
+glsl_tests_sampler_types_test_LDADD =                  \
+       $(top_builddir)/src/gtest/libgtest.la           \
+       glsl/libglsl.la                                 \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(PTHREAD_LIBS)
+
+noinst_LTLIBRARIES += glsl/libglsl.la glsl/libglcpp.la
+
+glsl_libglcpp_la_LIBADD =                              \
+       $(top_builddir)/src/util/libmesautil.la
+glsl_libglcpp_la_SOURCES =                             \
+       glsl/glcpp/glcpp-lex.c                          \
+       glsl/glcpp/glcpp-parse.c                        \
+       glsl/glcpp/glcpp-parse.h                        \
+       $(LIBGLCPP_FILES)
+
+glsl_glcpp_glcpp_SOURCES =                             \
+       glsl/glcpp/glcpp.c
+glsl_glcpp_glcpp_LDADD =                               \
+       glsl/libglcpp.la        \
+       $(top_builddir)/src/libglsl_util.la             \
+       -lm
+
+glsl_libglsl_la_LIBADD = \
+       nir/libnir.la \
+       glsl/libglcpp.la
+
+glsl_libglsl_la_SOURCES =                              \
+       glsl/glsl_lexer.cpp                             \
+       glsl/glsl_parser.cpp                            \
+       glsl/glsl_parser.h                              \
+       $(LIBGLSL_FILES)
+
+
+glsl_compiler_SOURCES = \
+       $(GLSL_COMPILER_CXX_FILES)
+
+glsl_compiler_LDADD =                                  \
+       glsl/libglsl.la                                 \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(top_builddir)/src/util/libmesautil.la         \
+       $(PTHREAD_LIBS)
+
+glsl_glsl_test_SOURCES = \
+       glsl/standalone_scaffolding.cpp \
+       glsl/test.cpp \
+       glsl/test_optpass.cpp \
+       glsl/test_optpass.h
+
+glsl_glsl_test_LDADD =                                 \
+       glsl/libglsl.la                                 \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(PTHREAD_LIBS)
+
+# We write our own rules for yacc and lex below. We'd rather use automake,
+# but automake makes it especially difficult for a number of reasons:
+#
+#  * < automake-1.12 generates .h files from .yy and .ypp files, but
+#    >=automake-1.12 generates .hh and .hpp files respectively. There's no
+#    good way of making a project that uses C++ yacc files compatible with
+#    both versions of automake. Strong work automake developers.
+#
+#  * Since we're generating code from .l/.y files in a subdirectory (glcpp/)
+#    we'd like the resulting generated code to also go in glcpp/ for purposes
+#    of distribution. Automake gives no way to do this.
+#
+#  * Since we're building multiple yacc parsers into one library (and via one
+#    Makefile) we have to use per-target YFLAGS. Using per-target YFLAGS causes
+#    automake to name the resulting generated code as <library-name>_filename.c.
+#    Frankly, that's ugly and we don't want a libglcpp_glcpp_parser.h file.
+
+# In order to make build output print "LEX" and "YACC", we reproduce the
+# automake variables below.
+
+AM_V_LEX = $(am__v_LEX_$(V))
+am__v_LEX_ = $(am__v_LEX_$(AM_DEFAULT_VERBOSITY))
+am__v_LEX_0 = @echo "  LEX     " $@;
+am__v_LEX_1 =
+
+AM_V_YACC = $(am__v_YACC_$(V))
+am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY))
+am__v_YACC_0 = @echo "  YACC    " $@;
+am__v_YACC_1 =
+
+MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
+YACC_GEN = $(AM_V_YACC)$(YACC) $(YFLAGS)
+LEX_GEN = $(AM_V_LEX)$(LEX) $(LFLAGS)
+
+glsl/glsl_parser.cpp glsl/glsl_parser.h: glsl/glsl_parser.yy
+       $(YACC_GEN) -o $@ -p "_mesa_glsl_" --defines=$(builddir)/glsl/glsl_parser.h $(srcdir)/glsl/glsl_parser.yy
+
+glsl/glsl_lexer.cpp: glsl/glsl_lexer.ll
+       $(LEX_GEN) -o $@ $(srcdir)/glsl/glsl_lexer.ll
+
+glsl/glcpp/glcpp-parse.c glsl/glcpp/glcpp-parse.h: glsl/glcpp/glcpp-parse.y
+       $(MKDIR_GEN)
+       $(YACC_GEN) -o $@ -p "glcpp_parser_" --defines=$(builddir)/glsl/glcpp/glcpp-parse.h $(srcdir)/glsl/glcpp/glcpp-parse.y
+
+glsl/glcpp/glcpp-lex.c: glsl/glcpp/glcpp-lex.l
+       $(MKDIR_GEN)
+       $(LEX_GEN) -o $@ $(srcdir)/glsl/glcpp/glcpp-lex.l
+
+# Only the parsers (specifically the header files generated at the same time)
+# need to be in BUILT_SOURCES. Though if we list the parser headers YACC is
+# called for the .c/.cpp file and the .h files. By listing the .c/.cpp files
+# YACC is only executed once for each parser. The rest of the generated code
+# will be created at the appropriate times according to standard automake
+# dependency rules.
+BUILT_SOURCES +=                                       \
+       glsl/glsl_parser.cpp                            \
+       glsl/glsl_lexer.cpp                             \
+       glsl/glcpp/glcpp-parse.c                        \
+       glsl/glcpp/glcpp-lex.c
+CLEANFILES +=                                          \
+       glsl/glcpp/glcpp-parse.h                        \
+       glsl/glsl_parser.h                              \
+       glsl/glsl_parser.cpp                            \
+       glsl/glsl_lexer.cpp                             \
+       glsl/glcpp/glcpp-parse.c                        \
+       glsl/glcpp/glcpp-lex.c
+
+clean-local:
+       $(RM) -r subtest-cr subtest-cr-lf subtest-lf subtest-lf-cr
+
+dist-hook:
+       $(RM) glsl/glcpp/tests/*.out
+       $(RM) glsl/glcpp/tests/subtest*/*.out
+
 noinst_LTLIBRARIES += nir/libnir.la
 
 nir_libnir_la_CPPFLAGS = \
@@ -101,7 +300,7 @@ nir_tests_control_flow_tests_CFLAGS =                       \
        $(PTHREAD_CFLAGS)
 nir_tests_control_flow_tests_LDADD =                   \
        $(top_builddir)/src/gtest/libgtest.la           \
-       $(top_builddir)/src/compiler/nir/libnir.la      \
+       nir/libnir.la   \
        $(top_builddir)/src/util/libmesautil.la         \
        $(PTHREAD_LIBS)
 
index fe12e419afb582ef840261e6f4327261f0c2b80a..c9780d6d6f75f26ef5d3d8fd62ff043158e104d5 100644 (file)
@@ -7,6 +7,153 @@ LIBCOMPILER_FILES = \
        shader_enums.c \
        shader_enums.h
 
+# libglsl
+
+LIBGLSL_FILES = \
+       glsl/ast.h \
+       glsl/ast_array_index.cpp \
+       glsl/ast_expr.cpp \
+       glsl/ast_function.cpp \
+       glsl/ast_to_hir.cpp \
+       glsl/ast_type.cpp \
+       glsl/blob.c \
+       glsl/blob.h \
+       glsl/builtin_functions.cpp \
+       glsl/builtin_types.cpp \
+       glsl/builtin_variables.cpp \
+       glsl/glsl_parser_extras.cpp \
+       glsl/glsl_parser_extras.h \
+       glsl/glsl_symbol_table.cpp \
+       glsl/glsl_symbol_table.h \
+       glsl/hir_field_selection.cpp \
+       glsl/ir_basic_block.cpp \
+       glsl/ir_basic_block.h \
+       glsl/ir_builder.cpp \
+       glsl/ir_builder.h \
+       glsl/ir_clone.cpp \
+       glsl/ir_constant_expression.cpp \
+       glsl/ir.cpp \
+       glsl/ir.h \
+       glsl/ir_equals.cpp \
+       glsl/ir_expression_flattening.cpp \
+       glsl/ir_expression_flattening.h \
+       glsl/ir_function_can_inline.cpp \
+       glsl/ir_function_detect_recursion.cpp \
+       glsl/ir_function_inlining.h \
+       glsl/ir_function.cpp \
+       glsl/ir_hierarchical_visitor.cpp \
+       glsl/ir_hierarchical_visitor.h \
+       glsl/ir_hv_accept.cpp \
+       glsl/ir_import_prototypes.cpp \
+       glsl/ir_optimization.h \
+       glsl/ir_print_visitor.cpp \
+       glsl/ir_print_visitor.h \
+       glsl/ir_reader.cpp \
+       glsl/ir_reader.h \
+       glsl/ir_rvalue_visitor.cpp \
+       glsl/ir_rvalue_visitor.h \
+       glsl/ir_set_program_inouts.cpp \
+       glsl/ir_uniform.h \
+       glsl/ir_validate.cpp \
+       glsl/ir_variable_refcount.cpp \
+       glsl/ir_variable_refcount.h \
+       glsl/ir_visitor.h \
+       glsl/linker.cpp \
+       glsl/linker.h \
+       glsl/link_atomics.cpp \
+       glsl/link_functions.cpp \
+       glsl/link_interface_blocks.cpp \
+       glsl/link_uniforms.cpp \
+       glsl/link_uniform_initializers.cpp \
+       glsl/link_uniform_block_active_visitor.cpp \
+       glsl/link_uniform_block_active_visitor.h \
+       glsl/link_uniform_blocks.cpp \
+       glsl/link_varyings.cpp \
+       glsl/link_varyings.h \
+       glsl/list.h \
+       glsl/loop_analysis.cpp \
+       glsl/loop_analysis.h \
+       glsl/loop_controls.cpp \
+       glsl/loop_unroll.cpp \
+       glsl/lower_buffer_access.cpp \
+       glsl/lower_buffer_access.h \
+       glsl/lower_clip_distance.cpp \
+       glsl/lower_const_arrays_to_uniforms.cpp \
+       glsl/lower_discard.cpp \
+       glsl/lower_discard_flow.cpp \
+       glsl/lower_if_to_cond_assign.cpp \
+       glsl/lower_instructions.cpp \
+       glsl/lower_jumps.cpp \
+       glsl/lower_mat_op_to_vec.cpp \
+       glsl/lower_noise.cpp \
+       glsl/lower_offset_array.cpp \
+       glsl/lower_packed_varyings.cpp \
+       glsl/lower_named_interface_blocks.cpp \
+       glsl/lower_packing_builtins.cpp \
+       glsl/lower_subroutine.cpp \
+       glsl/lower_tess_level.cpp \
+       glsl/lower_texture_projection.cpp \
+       glsl/lower_variable_index_to_cond_assign.cpp \
+       glsl/lower_vec_index_to_cond_assign.cpp \
+       glsl/lower_vec_index_to_swizzle.cpp \
+       glsl/lower_vector.cpp \
+       glsl/lower_vector_derefs.cpp \
+       glsl/lower_vector_insert.cpp \
+       glsl/lower_vertex_id.cpp \
+       glsl/lower_output_reads.cpp \
+       glsl/lower_shared_reference.cpp \
+       glsl/lower_ubo_reference.cpp \
+       glsl/opt_algebraic.cpp \
+       glsl/opt_array_splitting.cpp \
+       glsl/opt_conditional_discard.cpp \
+       glsl/opt_constant_folding.cpp \
+       glsl/opt_constant_propagation.cpp \
+       glsl/opt_constant_variable.cpp \
+       glsl/opt_copy_propagation.cpp \
+       glsl/opt_copy_propagation_elements.cpp \
+       glsl/opt_dead_builtin_variables.cpp \
+       glsl/opt_dead_builtin_varyings.cpp \
+       glsl/opt_dead_code.cpp \
+       glsl/opt_dead_code_local.cpp \
+       glsl/opt_dead_functions.cpp \
+       glsl/opt_flatten_nested_if_blocks.cpp \
+       glsl/opt_flip_matrices.cpp \
+       glsl/opt_function_inlining.cpp \
+       glsl/opt_if_simplification.cpp \
+       glsl/opt_minmax.cpp \
+       glsl/opt_noop_swizzle.cpp \
+       glsl/opt_rebalance_tree.cpp \
+       glsl/opt_redundant_jumps.cpp \
+       glsl/opt_structure_splitting.cpp \
+       glsl/opt_swizzle_swizzle.cpp \
+       glsl/opt_tree_grafting.cpp \
+       glsl/opt_vectorize.cpp \
+       glsl/program.h \
+       glsl/s_expression.cpp \
+       glsl/s_expression.h
+
+# glsl_compiler
+
+GLSL_COMPILER_CXX_FILES = \
+       glsl/standalone_scaffolding.cpp \
+       glsl/standalone_scaffolding.h \
+       glsl/main.cpp
+
+# libglsl generated sources
+LIBGLSL_GENERATED_CXX_FILES = \
+       glsl/glsl_lexer.cpp \
+       glsl/glsl_parser.cpp
+
+# libglcpp
+
+LIBGLCPP_FILES = \
+       glsl/glcpp/glcpp.h \
+       glsl/glcpp/pp.c
+
+LIBGLCPP_GENERATED_FILES = \
+       glsl/glcpp/glcpp-lex.c \
+       glsl/glcpp/glcpp-parse.c
+
 NIR_GENERATED_FILES = \
        nir/nir_builder_opcodes.h \
        nir/nir_constant_expressions.c \
index 412da0e62bdf5a07a63c9aa1d8b5ed4e9af19c73..8d71b82bee07bd144714667a26aa5f78b436dd6e 100644 (file)
@@ -20,3 +20,5 @@ compiler = env.ConvenienceLibrary(
     source = sources
 )
 Export('compiler')
+
+SConscript('glsl/SConscript')
diff --git a/src/compiler/glsl/.gitignore b/src/compiler/glsl/.gitignore
new file mode 100644 (file)
index 0000000..dda423f
--- /dev/null
@@ -0,0 +1,10 @@
+glsl_compiler
+glsl_lexer.cpp
+glsl_parser.cpp
+glsl_parser.h
+glsl_parser.output
+glsl_test
+subtest-cr/
+subtest-lf/
+subtest-cr-lf/
+subtest-lf-cr/
diff --git a/src/compiler/glsl/Android.gen.mk b/src/compiler/glsl/Android.gen.mk
new file mode 100644 (file)
index 0000000..c5741b4
--- /dev/null
@@ -0,0 +1,76 @@
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
+# Copyright (C) 2010-2011 LunarG Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+# included by glsl Android.mk for source generation
+
+ifeq ($(LOCAL_MODULE_CLASS),)
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+endif
+
+intermediates := $(call local-generated-sources-dir)
+
+LOCAL_SRC_FILES := $(LOCAL_SRC_FILES)
+
+LOCAL_C_INCLUDES += \
+       $(intermediates)/glcpp \
+       $(MESA_TOP)/src/glsl/glcpp \
+
+LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
+       $(LIBGLCPP_GENERATED_FILES) \
+       $(LIBGLSL_GENERATED_CXX_FILES))
+
+define local-l-or-ll-to-c-or-cpp
+       @mkdir -p $(dir $@)
+       @echo "Mesa Lex: $(PRIVATE_MODULE) <= $<"
+       $(hide) $(LEX) --nounistd -o$@ $<
+endef
+
+define glsl_local-y-to-c-and-h
+       @mkdir -p $(dir $@)
+       @echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<"
+       $(hide) $(YACC) -o $@ -p "glcpp_parser_" $<
+endef
+
+define local-yy-to-cpp-and-h
+       @mkdir -p $(dir $@)
+       @echo "Mesa Yacc: $(PRIVATE_MODULE) <= $<"
+       $(hide) $(YACC) -p "_mesa_glsl_" -o $@ $<
+       touch $(@:$1=$(YACC_HEADER_SUFFIX))
+       echo '#ifndef '$(@F:$1=_h) > $(@:$1=.h)
+       echo '#define '$(@F:$1=_h) >> $(@:$1=.h)
+       cat $(@:$1=$(YACC_HEADER_SUFFIX)) >> $(@:$1=.h)
+       echo '#endif' >> $(@:$1=.h)
+       rm -f $(@:$1=$(YACC_HEADER_SUFFIX))
+endef
+
+$(intermediates)/glsl_lexer.cpp: $(LOCAL_PATH)/glsl_lexer.ll
+       $(call local-l-or-ll-to-c-or-cpp)
+
+$(intermediates)/glsl_parser.cpp: $(LOCAL_PATH)/glsl_parser.yy
+       $(call local-yy-to-cpp-and-h,.cpp)
+
+$(intermediates)/glcpp/glcpp-lex.c: $(LOCAL_PATH)/glcpp/glcpp-lex.l
+       $(call local-l-or-ll-to-c-or-cpp)
+
+$(intermediates)/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glcpp/glcpp-parse.y
+       $(call glsl_local-y-to-c-and-h)
diff --git a/src/compiler/glsl/Android.mk b/src/compiler/glsl/Android.mk
new file mode 100644 (file)
index 0000000..9cbb9a3
--- /dev/null
@@ -0,0 +1,76 @@
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
+# Copyright (C) 2010-2011 LunarG Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+# Android.mk for glsl
+
+LOCAL_PATH := $(call my-dir)
+
+include $(LOCAL_PATH)/Makefile.sources
+
+# ---------------------------------------
+# Build libmesa_glsl
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+       $(LIBGLCPP_FILES) \
+       $(LIBGLSL_FILES) \
+       $(NIR_FILES)
+
+LOCAL_C_INCLUDES := \
+       $(MESA_TOP)/src/mapi \
+       $(MESA_TOP)/src/mesa \
+       $(MESA_TOP)/src/gallium/include \
+       $(MESA_TOP)/src/gallium/auxiliary
+
+LOCAL_STATIC_LIBRARIES := libmesa_compiler
+
+LOCAL_MODULE := libmesa_glsl
+
+include $(LOCAL_PATH)/Android.gen.mk
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# ---------------------------------------
+# Build glsl_compiler
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+       $(GLSL_COMPILER_CXX_FILES)
+
+LOCAL_C_INCLUDES := \
+       $(MESA_TOP)/src/mapi \
+       $(MESA_TOP)/src/mesa \
+       $(MESA_TOP)/src/gallium/include \
+       $(MESA_TOP)/src/gallium/auxiliary
+
+LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_glsl_utils libmesa_util
+
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE := glsl_compiler
+
+include $(MESA_COMMON_MK)
+include $(BUILD_EXECUTABLE)
diff --git a/src/compiler/glsl/Makefile.am b/src/compiler/glsl/Makefile.am
new file mode 100644 (file)
index 0000000..9954b81
--- /dev/null
@@ -0,0 +1,228 @@
+# Copyright © 2012 Jon TURNEY
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+AM_CPPFLAGS = \
+       -I$(top_srcdir)/include \
+       -I$(top_srcdir)/src \
+       -I$(top_srcdir)/src/mapi \
+       -I$(top_srcdir)/src/mesa/ \
+       -I$(top_srcdir)/src/gallium/include \
+       -I$(top_srcdir)/src/gallium/auxiliary \
+       -I$(top_srcdir)/src/glsl/glcpp \
+       -I$(top_srcdir)/src/gtest/include \
+       $(DEFINES)
+AM_CFLAGS = \
+       $(VISIBILITY_CFLAGS) \
+       $(MSVC2013_COMPAT_CFLAGS)
+AM_CXXFLAGS = \
+       $(VISIBILITY_CXXFLAGS) \
+       $(MSVC2013_COMPAT_CXXFLAGS)
+
+EXTRA_DIST = tests glcpp/tests README TODO glcpp/README        \
+       glsl_lexer.ll                                   \
+       glsl_parser.yy                                  \
+       glcpp/glcpp-lex.l                               \
+       glcpp/glcpp-parse.y                             \
+       SConscript
+
+include Makefile.sources
+
+TESTS = glcpp/tests/glcpp-test                         \
+       glcpp/tests/glcpp-test-cr-lf                    \
+       tests/blob-test                                 \
+       tests/general-ir-test                           \
+       tests/optimization-test                         \
+       tests/sampler-types-test                        \
+       tests/uniform-initializer-test
+
+TESTS_ENVIRONMENT= \
+       export PYTHON2=$(PYTHON2); \
+       export PYTHON_FLAGS=$(PYTHON_FLAGS);
+
+noinst_LTLIBRARIES = libglsl.la libglcpp.la
+check_PROGRAMS =                                       \
+       glcpp/glcpp                                     \
+       glsl_test                                       \
+       tests/blob-test                                 \
+       tests/general-ir-test                           \
+       tests/sampler-types-test                        \
+       tests/uniform-initializer-test
+
+noinst_PROGRAMS = glsl_compiler
+
+tests_blob_test_SOURCES =                              \
+       tests/blob_test.c
+tests_blob_test_LDADD =                                        \
+       $(top_builddir)/src/glsl/libglsl.la
+
+tests_general_ir_test_SOURCES =                \
+       standalone_scaffolding.cpp                      \
+       tests/builtin_variable_test.cpp                 \
+       tests/invalidate_locations_test.cpp             \
+       tests/general_ir_test.cpp                       \
+       tests/varyings_test.cpp
+tests_general_ir_test_CFLAGS =                         \
+       $(PTHREAD_CFLAGS)
+tests_general_ir_test_LDADD =                          \
+       $(top_builddir)/src/gtest/libgtest.la           \
+       $(top_builddir)/src/glsl/libglsl.la             \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(PTHREAD_LIBS)
+
+tests_uniform_initializer_test_SOURCES =               \
+       tests/copy_constant_to_storage_tests.cpp        \
+       tests/set_uniform_initializer_tests.cpp         \
+       tests/uniform_initializer_utils.cpp             \
+       tests/uniform_initializer_utils.h
+tests_uniform_initializer_test_CFLAGS =                        \
+       $(PTHREAD_CFLAGS)
+tests_uniform_initializer_test_LDADD =                 \
+       $(top_builddir)/src/gtest/libgtest.la           \
+       $(top_builddir)/src/glsl/libglsl.la             \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(PTHREAD_LIBS)
+
+tests_sampler_types_test_SOURCES =                     \
+       tests/sampler_types_test.cpp
+tests_sampler_types_test_CFLAGS =                      \
+       $(PTHREAD_CFLAGS)
+tests_sampler_types_test_LDADD =                       \
+       $(top_builddir)/src/gtest/libgtest.la           \
+       $(top_builddir)/src/glsl/libglsl.la             \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(PTHREAD_LIBS)
+
+libglcpp_la_LIBADD =                                   \
+       $(top_builddir)/src/util/libmesautil.la
+libglcpp_la_SOURCES =                                  \
+       glcpp/glcpp-lex.c                               \
+       glcpp/glcpp-parse.c                             \
+       glcpp/glcpp-parse.h                             \
+       $(LIBGLCPP_FILES)
+
+glcpp_glcpp_SOURCES =                                  \
+       glcpp/glcpp.c
+glcpp_glcpp_LDADD =                                    \
+       libglcpp.la                                     \
+       $(top_builddir)/src/libglsl_util.la             \
+       -lm
+
+libglsl_la_LIBADD = \
+       $(top_builddir)/src/compiler/nir/libnir.la \
+       libglcpp.la
+
+libglsl_la_SOURCES =                                   \
+       glsl_lexer.cpp                                  \
+       glsl_parser.cpp                                 \
+       glsl_parser.h                                   \
+       $(LIBGLSL_FILES)
+
+
+glsl_compiler_SOURCES = \
+       $(GLSL_COMPILER_CXX_FILES)
+
+glsl_compiler_LDADD =                                  \
+       libglsl.la                                      \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(top_builddir)/src/util/libmesautil.la         \
+       $(PTHREAD_LIBS)
+
+glsl_test_SOURCES = \
+       standalone_scaffolding.cpp \
+       test.cpp \
+       test_optpass.cpp \
+       test_optpass.h
+
+glsl_test_LDADD =                                      \
+       libglsl.la                                      \
+       $(top_builddir)/src/libglsl_util.la             \
+       $(PTHREAD_LIBS)
+
+# We write our own rules for yacc and lex below. We'd rather use automake,
+# but automake makes it especially difficult for a number of reasons:
+#
+#  * < automake-1.12 generates .h files from .yy and .ypp files, but
+#    >=automake-1.12 generates .hh and .hpp files respectively. There's no
+#    good way of making a project that uses C++ yacc files compatible with
+#    both versions of automake. Strong work automake developers.
+#
+#  * Since we're generating code from .l/.y files in a subdirectory (glcpp/)
+#    we'd like the resulting generated code to also go in glcpp/ for purposes
+#    of distribution. Automake gives no way to do this.
+#
+#  * Since we're building multiple yacc parsers into one library (and via one
+#    Makefile) we have to use per-target YFLAGS. Using per-target YFLAGS causes
+#    automake to name the resulting generated code as <library-name>_filename.c.
+#    Frankly, that's ugly and we don't want a libglcpp_glcpp_parser.h file.
+
+# In order to make build output print "LEX" and "YACC", we reproduce the
+# automake variables below.
+
+AM_V_LEX = $(am__v_LEX_$(V))
+am__v_LEX_ = $(am__v_LEX_$(AM_DEFAULT_VERBOSITY))
+am__v_LEX_0 = @echo "  LEX     " $@;
+am__v_LEX_1 =
+
+AM_V_YACC = $(am__v_YACC_$(V))
+am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY))
+am__v_YACC_0 = @echo "  YACC    " $@;
+am__v_YACC_1 =
+
+MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
+YACC_GEN = $(AM_V_YACC)$(YACC) $(YFLAGS)
+LEX_GEN = $(AM_V_LEX)$(LEX) $(LFLAGS)
+
+glsl_parser.cpp glsl_parser.h: glsl_parser.yy
+       $(YACC_GEN) -o $@ -p "_mesa_glsl_" --defines=$(builddir)/glsl_parser.h $(srcdir)/glsl_parser.yy
+
+glsl_lexer.cpp: glsl_lexer.ll
+       $(LEX_GEN) -o $@ $(srcdir)/glsl_lexer.ll
+
+glcpp/glcpp-parse.c glcpp/glcpp-parse.h: glcpp/glcpp-parse.y
+       $(MKDIR_GEN)
+       $(YACC_GEN) -o $@ -p "glcpp_parser_" --defines=$(builddir)/glcpp/glcpp-parse.h $(srcdir)/glcpp/glcpp-parse.y
+
+glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
+       $(MKDIR_GEN)
+       $(LEX_GEN) -o $@ $(srcdir)/glcpp/glcpp-lex.l
+
+# Only the parsers (specifically the header files generated at the same time)
+# need to be in BUILT_SOURCES. Though if we list the parser headers YACC is
+# called for the .c/.cpp file and the .h files. By listing the .c/.cpp files
+# YACC is only executed once for each parser. The rest of the generated code
+# will be created at the appropriate times according to standard automake
+# dependency rules.
+BUILT_SOURCES =                                                \
+       glsl_parser.cpp                                 \
+       glsl_lexer.cpp                                  \
+       glcpp/glcpp-parse.c                             \
+       glcpp/glcpp-lex.c
+CLEANFILES =                                           \
+       glcpp/glcpp-parse.h                             \
+       glsl_parser.h                                   \
+       $(BUILT_SOURCES)
+
+clean-local:
+       $(RM) -r subtest-cr subtest-cr-lf subtest-lf subtest-lf-cr
+
+dist-hook:
+       $(RM) glcpp/tests/*.out
+       $(RM) glcpp/tests/subtest*/*.out
diff --git a/src/compiler/glsl/Makefile.sources b/src/compiler/glsl/Makefile.sources
new file mode 100644 (file)
index 0000000..08b40c5
--- /dev/null
@@ -0,0 +1,222 @@
+# shared source lists for Makefile, SConscript, and Android.mk
+
+# libglcpp
+
+LIBGLCPP_FILES = \
+       glcpp/glcpp.h \
+       glcpp/pp.c
+
+LIBGLCPP_GENERATED_FILES = \
+       glcpp/glcpp-lex.c \
+       glcpp/glcpp-parse.c
+
+NIR_GENERATED_FILES = \
+       nir/nir_builder_opcodes.h \
+       nir/nir_constant_expressions.c \
+       nir/nir_opcodes.c \
+       nir/nir_opcodes.h \
+       nir/nir_opt_algebraic.c
+
+NIR_FILES = \
+       nir/nir.c \
+       nir/nir.h \
+       nir/nir_array.h \
+       nir/nir_builder.h \
+       nir/nir_clone.c \
+       nir/nir_constant_expressions.h \
+       nir/nir_control_flow.c \
+       nir/nir_control_flow.h \
+       nir/nir_control_flow_private.h \
+       nir/nir_dominance.c \
+       nir/nir_from_ssa.c \
+       nir/nir_gs_count_vertices.c \
+       nir/nir_intrinsics.c \
+       nir/nir_intrinsics.h \
+       nir/nir_instr_set.c \
+       nir/nir_instr_set.h \
+       nir/nir_liveness.c \
+       nir/nir_lower_alu_to_scalar.c \
+       nir/nir_lower_atomics.c \
+       nir/nir_lower_clip.c \
+       nir/nir_lower_global_vars_to_local.c \
+       nir/nir_lower_gs_intrinsics.c \
+       nir/nir_lower_load_const_to_scalar.c \
+       nir/nir_lower_locals_to_regs.c \
+       nir/nir_lower_idiv.c \
+       nir/nir_lower_io.c \
+       nir/nir_lower_outputs_to_temporaries.c \
+       nir/nir_lower_phis_to_scalar.c \
+       nir/nir_lower_samplers.c \
+       nir/nir_lower_system_values.c \
+       nir/nir_lower_tex.c \
+       nir/nir_lower_to_source_mods.c \
+       nir/nir_lower_two_sided_color.c \
+       nir/nir_lower_vars_to_ssa.c \
+       nir/nir_lower_var_copies.c \
+       nir/nir_lower_vec_to_movs.c \
+       nir/nir_metadata.c \
+       nir/nir_move_vec_src_uses_to_dest.c \
+       nir/nir_normalize_cubemap_coords.c \
+       nir/nir_opt_constant_folding.c \
+       nir/nir_opt_copy_propagate.c \
+       nir/nir_opt_cse.c \
+       nir/nir_opt_dce.c \
+       nir/nir_opt_dead_cf.c \
+       nir/nir_opt_gcm.c \
+       nir/nir_opt_global_to_local.c \
+       nir/nir_opt_peephole_select.c \
+       nir/nir_opt_remove_phis.c \
+       nir/nir_opt_undef.c \
+       nir/nir_print.c \
+       nir/nir_remove_dead_variables.c \
+       nir/nir_search.c \
+       nir/nir_search.h \
+       nir/nir_split_var_copies.c \
+       nir/nir_sweep.c \
+       nir/nir_to_ssa.c \
+       nir/nir_validate.c \
+       nir/nir_vla.h \
+       nir/nir_worklist.c \
+       nir/nir_worklist.h
+
+# libglsl
+
+LIBGLSL_FILES = \
+       ast.h \
+       ast_array_index.cpp \
+       ast_expr.cpp \
+       ast_function.cpp \
+       ast_to_hir.cpp \
+       ast_type.cpp \
+       blob.c \
+       blob.h \
+       builtin_functions.cpp \
+       builtin_types.cpp \
+       builtin_variables.cpp \
+       glsl_parser_extras.cpp \
+       glsl_parser_extras.h \
+       glsl_symbol_table.cpp \
+       glsl_symbol_table.h \
+       hir_field_selection.cpp \
+       ir_basic_block.cpp \
+       ir_basic_block.h \
+       ir_builder.cpp \
+       ir_builder.h \
+       ir_clone.cpp \
+       ir_constant_expression.cpp \
+       ir.cpp \
+       ir.h \
+       ir_equals.cpp \
+       ir_expression_flattening.cpp \
+       ir_expression_flattening.h \
+       ir_function_can_inline.cpp \
+       ir_function_detect_recursion.cpp \
+       ir_function_inlining.h \
+       ir_function.cpp \
+       ir_hierarchical_visitor.cpp \
+       ir_hierarchical_visitor.h \
+       ir_hv_accept.cpp \
+       ir_import_prototypes.cpp \
+       ir_optimization.h \
+       ir_print_visitor.cpp \
+       ir_print_visitor.h \
+       ir_reader.cpp \
+       ir_reader.h \
+       ir_rvalue_visitor.cpp \
+       ir_rvalue_visitor.h \
+       ir_set_program_inouts.cpp \
+       ir_uniform.h \
+       ir_validate.cpp \
+       ir_variable_refcount.cpp \
+       ir_variable_refcount.h \
+       ir_visitor.h \
+       linker.cpp \
+       linker.h \
+       link_atomics.cpp \
+       link_functions.cpp \
+       link_interface_blocks.cpp \
+       link_uniforms.cpp \
+       link_uniform_initializers.cpp \
+       link_uniform_block_active_visitor.cpp \
+       link_uniform_block_active_visitor.h \
+       link_uniform_blocks.cpp \
+       link_varyings.cpp \
+       link_varyings.h \
+       list.h \
+       loop_analysis.cpp \
+       loop_analysis.h \
+       loop_controls.cpp \
+       loop_unroll.cpp \
+       lower_buffer_access.cpp \
+       lower_buffer_access.h \
+       lower_clip_distance.cpp \
+       lower_const_arrays_to_uniforms.cpp \
+       lower_discard.cpp \
+       lower_discard_flow.cpp \
+       lower_if_to_cond_assign.cpp \
+       lower_instructions.cpp \
+       lower_jumps.cpp \
+       lower_mat_op_to_vec.cpp \
+       lower_noise.cpp \
+       lower_offset_array.cpp \
+       lower_packed_varyings.cpp \
+       lower_named_interface_blocks.cpp \
+       lower_packing_builtins.cpp \
+       lower_subroutine.cpp \
+       lower_tess_level.cpp \
+       lower_texture_projection.cpp \
+       lower_variable_index_to_cond_assign.cpp \
+       lower_vec_index_to_cond_assign.cpp \
+       lower_vec_index_to_swizzle.cpp \
+       lower_vector.cpp \
+       lower_vector_derefs.cpp \
+       lower_vector_insert.cpp \
+       lower_vertex_id.cpp \
+       lower_output_reads.cpp \
+       lower_shared_reference.cpp \
+       lower_ubo_reference.cpp \
+       opt_algebraic.cpp \
+       opt_array_splitting.cpp \
+       opt_conditional_discard.cpp \
+       opt_constant_folding.cpp \
+       opt_constant_propagation.cpp \
+       opt_constant_variable.cpp \
+       opt_copy_propagation.cpp \
+       opt_copy_propagation_elements.cpp \
+       opt_dead_builtin_variables.cpp \
+       opt_dead_builtin_varyings.cpp \
+       opt_dead_code.cpp \
+       opt_dead_code_local.cpp \
+       opt_dead_functions.cpp \
+       opt_flatten_nested_if_blocks.cpp \
+       opt_flip_matrices.cpp \
+       opt_function_inlining.cpp \
+       opt_if_simplification.cpp \
+       opt_minmax.cpp \
+       opt_noop_swizzle.cpp \
+       opt_rebalance_tree.cpp \
+       opt_redundant_jumps.cpp \
+       opt_structure_splitting.cpp \
+       opt_swizzle_swizzle.cpp \
+       opt_tree_grafting.cpp \
+       opt_vectorize.cpp \
+       program.h \
+       s_expression.cpp \
+       s_expression.h
+
+# glsl to nir pass
+GLSL_TO_NIR_FILES = \
+       nir/glsl_to_nir.cpp \
+       nir/glsl_to_nir.h
+
+# glsl_compiler
+
+GLSL_COMPILER_CXX_FILES = \
+       standalone_scaffolding.cpp \
+       standalone_scaffolding.h \
+       main.cpp
+
+# libglsl generated sources
+LIBGLSL_GENERATED_CXX_FILES = \
+       glsl_lexer.cpp \
+       glsl_parser.cpp
diff --git a/src/compiler/glsl/README b/src/compiler/glsl/README
new file mode 100644 (file)
index 0000000..bfcf69f
--- /dev/null
@@ -0,0 +1,228 @@
+Welcome to Mesa's GLSL compiler.  A brief overview of how things flow:
+
+1) lex and yacc-based preprocessor takes the incoming shader string
+and produces a new string containing the preprocessed shader.  This
+takes care of things like #if, #ifdef, #define, and preprocessor macro
+invocations.  Note that #version, #extension, and some others are
+passed straight through.  See glcpp/*
+
+2) lex and yacc-based parser takes the preprocessed string and
+generates the AST (abstract syntax tree).  Almost no checking is
+performed in this stage.  See glsl_lexer.ll and glsl_parser.yy.
+
+3) The AST is converted to "HIR".  This is the intermediate
+representation of the compiler.  Constructors are generated, function
+calls are resolved to particular function signatures, and all the
+semantic checking is performed.  See ast_*.cpp for the conversion, and
+ir.h for the IR structures.
+
+4) The driver (Mesa, or main.cpp for the standalone binary) performs
+optimizations.  These include copy propagation, dead code elimination,
+constant folding, and others.  Generally the driver will call
+optimizations in a loop, as each may open up opportunities for other
+optimizations to do additional work.  See most files called ir_*.cpp
+
+5) linking is performed.  This does checking to ensure that the
+outputs of the vertex shader match the inputs of the fragment shader,
+and assigns locations to uniforms, attributes, and varyings.  See
+linker.cpp.
+
+6) The driver may perform additional optimization at this point, as
+for example dead code elimination previously couldn't remove functions
+or global variable usage when we didn't know what other code would be
+linked in.
+
+7) The driver performs code generation out of the IR, taking a linked
+shader program and producing a compiled program for each stage.  See
+../mesa/program/ir_to_mesa.cpp for Mesa IR code generation.
+
+FAQ:
+
+Q: What is HIR versus IR versus LIR?
+
+A: The idea behind the naming was that ast_to_hir would produce a
+high-level IR ("HIR"), with things like matrix operations, structure
+assignments, etc., present.  A series of lowering passes would occur
+that do things like break matrix multiplication into a series of dot
+products/MADs, make structure assignment be a series of assignment of
+components, flatten if statements into conditional moves, and such,
+producing a low level IR ("LIR").
+
+However, it now appears that each driver will have different
+requirements from a LIR.  A 915-generation chipset wants all functions
+inlined, all loops unrolled, all ifs flattened, no variable array
+accesses, and matrix multiplication broken down.  The Mesa IR backend
+for swrast would like matrices and structure assignment broken down,
+but it can support function calls and dynamic branching.  A 965 vertex
+shader IR backend could potentially even handle some matrix operations
+without breaking them down, but the 965 fragment shader IR backend
+would want to break to have (almost) all operations down channel-wise
+and perform optimization on that.  As a result, there's no single
+low-level IR that will make everyone happy.  So that usage has fallen
+out of favor, and each driver will perform a series of lowering passes
+to take the HIR down to whatever restrictions it wants to impose
+before doing codegen.
+
+Q: How is the IR structured?
+
+A: The best way to get started seeing it would be to run the
+standalone compiler against a shader:
+
+./glsl_compiler --dump-lir \
+       ~/src/piglit/tests/shaders/glsl-orangebook-ch06-bump.frag
+
+So for example one of the ir_instructions in main() contains:
+
+(assign (constant bool (1)) (var_ref litColor)  (expression vec3 * (var_ref Surf
+aceColor) (var_ref __retval) ) )
+
+Or more visually:
+                     (assign)
+                 /       |        \
+        (var_ref)  (expression *)  (constant bool 1)
+         /          /           \
+(litColor)      (var_ref)    (var_ref)
+                  /                  \
+           (SurfaceColor)          (__retval)
+
+which came from:
+
+litColor = SurfaceColor * max(dot(normDelta, LightDir), 0.0);
+
+(the max call is not represented in this expression tree, as it was a
+function call that got inlined but not brought into this expression
+tree)
+
+Each of those nodes is a subclass of ir_instruction.  A particular
+ir_instruction instance may only appear once in the whole IR tree with
+the exception of ir_variables, which appear once as variable
+declarations:
+
+(declare () vec3 normDelta)
+
+and multiple times as the targets of variable dereferences:
+...
+(assign (constant bool (1)) (var_ref __retval) (expression float dot
+ (var_ref normDelta) (var_ref LightDir) ) )
+...
+(assign (constant bool (1)) (var_ref __retval) (expression vec3 -
+ (var_ref LightDir) (expression vec3 * (constant float (2.000000))
+ (expression vec3 * (expression float dot (var_ref normDelta) (var_ref
+ LightDir) ) (var_ref normDelta) ) ) ) )
+...
+
+Each node has a type.  Expressions may involve several different types:
+(declare (uniform ) mat4 gl_ModelViewMatrix)
+((assign (constant bool (1)) (var_ref constructor_tmp) (expression
+ vec4 * (var_ref gl_ModelViewMatrix) (var_ref gl_Vertex) ) )
+
+An expression tree can be arbitrarily deep, and the compiler tries to
+keep them structured like that so that things like algebraic
+optimizations ((color * 1.0 == color) and ((mat1 * mat2) * vec == mat1
+* (mat2 * vec))) or recognizing operation patterns for code generation
+(vec1 * vec2 + vec3 == mad(vec1, vec2, vec3)) are easier.  This comes
+at the expense of additional trickery in implementing some
+optimizations like CSE where one must navigate an expression tree.
+
+Q: Why no SSA representation?
+
+A: Converting an IR tree to SSA form makes dead code elimination,
+common subexpression elimination, and many other optimizations much
+easier.  However, in our primarily vector-based language, there's some
+major questions as to how it would work.  Do we do SSA on the scalar
+or vector level?  If we do it at the vector level, we're going to end
+up with many different versions of the variable when encountering code
+like:
+
+(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) )
+(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) )
+(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) )
+
+If every masked update of a component relies on the previous value of
+the variable, then we're probably going to be quite limited in our
+dead code elimination wins, and recognizing common expressions may
+just not happen.  On the other hand, if we operate channel-wise, then
+we'll be prone to optimizing the operation on one of the channels at
+the expense of making its instruction flow different from the other
+channels, and a vector-based GPU would end up with worse code than if
+we didn't optimize operations on that channel!
+
+Once again, it appears that our optimization requirements are driven
+significantly by the target architecture.  For now, targeting the Mesa
+IR backend, SSA does not appear to be that important to producing
+excellent code, but we do expect to do some SSA-based optimizations
+for the 965 fragment shader backend when that is developed.
+
+Q: How should I expand instructions that take multiple backend instructions?
+
+Sometimes you'll have to do the expansion in your code generation --
+see, for example, ir_to_mesa.cpp's handling of ir_unop_sqrt.  However,
+in many cases you'll want to do a pass over the IR to convert
+non-native instructions to a series of native instructions.  For
+example, for the Mesa backend we have ir_div_to_mul_rcp.cpp because
+Mesa IR (and many hardware backends) only have a reciprocal
+instruction, not a divide.  Implementing non-native instructions this
+way gives the chance for constant folding to occur, so (a / 2.0)
+becomes (a * 0.5) after codegen instead of (a * (1.0 / 2.0))
+
+Q: How shoud I handle my special hardware instructions with respect to IR?
+
+Our current theory is that if multiple targets have an instruction for
+some operation, then we should probably be able to represent that in
+the IR.  Generally this is in the form of an ir_{bin,un}op expression
+type.  For example, we initially implemented fract() using (a -
+floor(a)), but both 945 and 965 have instructions to give that result,
+and it would also simplify the implementation of mod(), so
+ir_unop_fract was added.  The following areas need updating to add a
+new expression type:
+
+ir.h (new enum)
+ir.cpp:operator_strs (used for ir_reader)
+ir_constant_expression.cpp (you probably want to be able to constant fold)
+ir_validate.cpp (check users have the right types)
+
+You may also need to update the backends if they will see the new expr type:
+
+../mesa/program/ir_to_mesa.cpp
+
+You can then use the new expression from builtins (if all backends
+would rather see it), or scan the IR and convert to use your new
+expression type (see ir_mod_to_floor, for example).
+
+Q: How is memory management handled in the compiler?
+
+The hierarchical memory allocator "talloc" developed for the Samba
+project is used, so that things like optimization passes don't have to
+worry about their garbage collection so much.  It has a few nice
+features, including low performance overhead and good debugging
+support that's trivially available.
+
+Generally, each stage of the compile creates a talloc context and
+allocates its memory out of that or children of it.  At the end of the
+stage, the pieces still live are stolen to a new context and the old
+one freed, or the whole context is kept for use by the next stage.
+
+For IR transformations, a temporary context is used, then at the end
+of all transformations, reparent_ir reparents all live nodes under the
+shader's IR list, and the old context full of dead nodes is freed.
+When developing a single IR transformation pass, this means that you
+want to allocate instruction nodes out of the temporary context, so if
+it becomes dead it doesn't live on as the child of a live node.  At
+the moment, optimization passes aren't passed that temporary context,
+so they find it by calling talloc_parent() on a nearby IR node.  The
+talloc_parent() call is expensive, so many passes will cache the
+result of the first talloc_parent().  Cleaning up all the optimization
+passes to take a context argument and not call talloc_parent() is left
+as an exercise.
+
+Q: What is the file naming convention in this directory?
+
+Initially, there really wasn't one.  We have since adopted one:
+
+ - Files that implement code lowering passes should be named lower_*
+   (e.g., lower_noise.cpp).
+ - Files that implement optimization passes should be named opt_*.
+ - Files that implement a class that is used throught the code should
+   take the name of that class (e.g., ir_hierarchical_visitor.cpp).
+ - Files that contain code not fitting in one of the previous
+   categories should have a sensible name (e.g., glsl_parser.yy).
diff --git a/src/compiler/glsl/SConscript b/src/compiler/glsl/SConscript
new file mode 100644 (file)
index 0000000..ef82a9d
--- /dev/null
@@ -0,0 +1,122 @@
+import common
+
+Import('*')
+
+from sys import executable as python_cmd
+
+env = env.Clone()
+
+env.MSVC2013Compat()
+
+env.Prepend(CPPPATH = [
+    '#include',
+    '#src',
+    '#src/mapi',
+    '#src/mesa',
+    '#src/gallium/include',
+    '#src/gallium/auxiliary',
+    '#src/glsl',
+    '#src/glsl/glcpp',
+])
+
+env.Prepend(LIBS = [mesautil])
+
+# Make glcpp-parse.h and glsl_parser.h reachable from the include path.
+env.Append(CPPPATH = [Dir('.').abspath, Dir('glcpp').abspath])
+
+glcpp_env = env.Clone()
+glcpp_env.Append(YACCFLAGS = [
+    '-d',
+    '-p', 'glcpp_parser_'
+])
+
+glsl_env = env.Clone()
+glsl_env.Append(YACCFLAGS = [
+    '--defines=%s' % File('glsl_parser.h').abspath,
+    '-p', '_mesa_glsl_',
+])
+
+# without this line scons will expect "glsl_parser.hpp" instead of
+# "glsl_parser.h", causing glsl_parser.cpp to be regenerated every time
+glsl_env['YACCHXXFILESUFFIX'] = '.h'
+
+glcpp_lexer = glcpp_env.CFile('glcpp/glcpp-lex.c', 'glcpp/glcpp-lex.l')
+glcpp_parser = glcpp_env.CFile('glcpp/glcpp-parse.c', 'glcpp/glcpp-parse.y')
+glsl_lexer = glsl_env.CXXFile('glsl_lexer.cpp', 'glsl_lexer.ll')
+glsl_parser = glsl_env.CXXFile('glsl_parser.cpp', 'glsl_parser.yy')
+
+# common generated sources
+glsl_sources = [
+    glcpp_lexer,
+    glcpp_parser[0],
+    glsl_lexer,
+    glsl_parser[0],
+] 
+
+# parse Makefile.sources
+source_lists = env.ParseSourceList('Makefile.sources')
+
+# add non-generated sources
+for l in ('LIBGLCPP_FILES', 'LIBGLSL_FILES'):
+    glsl_sources += source_lists[l]
+
+if env['msvc']:
+    env.Prepend(CPPPATH = ['#/src/getopt'])
+    env.PrependUnique(LIBS = [getopt])
+
+# Copy these files to avoid generation object files into src/mesa/program
+env.Prepend(CPPPATH = ['#src/mesa/main'])
+env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE'))
+# Copy these files to avoid generation object files into src/mesa/program
+env.Prepend(CPPPATH = ['#src/mesa/program'])
+env.Command('prog_hash_table.c', '#src/mesa/program/prog_hash_table.c', Copy('$TARGET', '$SOURCE'))
+env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET', '$SOURCE'))
+env.Command('dummy_errors.c', '#src/mesa/program/dummy_errors.c', Copy('$TARGET', '$SOURCE'))
+
+compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES'])
+
+mesa_objs = env.StaticObject([
+    'imports.c',
+    'prog_hash_table.c',
+    'symbol_table.c',
+    'dummy_errors.c',
+])
+
+compiler_objs += mesa_objs
+
+glsl = env.ConvenienceLibrary(
+    target = 'glsl',
+    source = glsl_sources,
+)
+
+# SCons builtin dependency scanner doesn't detect that glsl_lexer.ll depends on
+# glsl_parser.h
+env.Depends(glsl, glsl_parser)
+
+Export('glsl')
+
+# Skip building these programs as they will cause SCons error "Two environments
+# with different actions were specified for the same target"
+if env['crosscompile'] or env['embedded']:
+    Return()
+
+env = env.Clone()
+
+if env['platform'] == 'windows':
+    env.PrependUnique(LIBS = [
+        'user32',
+    ])
+
+env.Prepend(LIBS = [compiler, glsl])
+
+glsl_compiler = env.Program(
+    target = 'glsl_compiler',
+    source = compiler_objs,
+)
+env.Alias('glsl_compiler', glsl_compiler)
+
+glcpp = env.Program(
+    target = 'glcpp/glcpp',
+    source = ['glcpp/glcpp.c'] + mesa_objs,
+)
+env.Alias('glcpp', glcpp)
diff --git a/src/compiler/glsl/TODO b/src/compiler/glsl/TODO
new file mode 100644 (file)
index 0000000..bd077a8
--- /dev/null
@@ -0,0 +1,12 @@
+- Detect code paths in non-void functions that don't reach a return statement
+
+- Improve handling of constants and their initializers.  Constant initializers
+  should never generate any code.  This is trival for scalar constants.  It is
+  also trivial for arrays, matrices, and vectors that are accessed with
+  constant index values.  For others it is more complicated.  Perhaps these
+  cases should be silently converted to uniforms?
+
+- Track source locations throughout the IR.  There are currently several
+  places where we cannot emit line numbers for errors (and currently emit 0:0)
+  because we've "lost" the line number information.  This is particularly
+  noticeable at link time.
diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h
new file mode 100644 (file)
index 0000000..03df6c0
--- /dev/null
@@ -0,0 +1,1204 @@
+/* -*- c++ -*- */
+/*
+ * Copyright © 2009 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef AST_H
+#define AST_H
+
+#include "list.h"
+#include "glsl_parser_extras.h"
+
+struct _mesa_glsl_parse_state;
+
+struct YYLTYPE;
+
+/**
+ * \defgroup AST Abstract syntax tree node definitions
+ *
+ * An abstract syntax tree is generated by the parser.  This is a fairly
+ * direct representation of the gramma derivation for the source program.
+ * No symantic checking is done during the generation of the AST.  Only
+ * syntactic checking is done.  Symantic checking is performed by a later
+ * stage that converts the AST to a more generic intermediate representation.
+ *
+ *@{
+ */
+/**
+ * Base class of all abstract syntax tree nodes
+ */
+class ast_node {
+public:
+   DECLARE_RALLOC_CXX_OPERATORS(ast_node);
+
+   /**
+    * Print an AST node in something approximating the original GLSL code
+    */
+   virtual void print(void) const;
+
+   /**
+    * Convert the AST node to the high-level intermediate representation
+    */
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   virtual bool has_sequence_subexpression() const;
+
+   /**
+    * Retrieve the source location of an AST node
+    *
+    * This function is primarily used to get the source position of an AST node
+    * into a form that can be passed to \c _mesa_glsl_error.
+    *
+    * \sa _mesa_glsl_error, ast_node::set_location
+    */
+   struct YYLTYPE get_location(void) const
+   {
+      struct YYLTYPE locp;
+
+      locp.source = this->location.source;
+      locp.first_line = this->location.first_line;
+      locp.first_column = this->location.first_column;
+      locp.last_line = this->location.last_line;
+      locp.last_column = this->location.last_column;
+
+      return locp;
+   }
+
+   /**
+    * Set the source location of an AST node from a parser location
+    *
+    * \sa ast_node::get_location
+    */
+   void set_location(const struct YYLTYPE &locp)
+   {
+      this->location.source = locp.source;
+      this->location.first_line = locp.first_line;
+      this->location.first_column = locp.first_column;
+      this->location.last_line = locp.last_line;
+      this->location.last_column = locp.last_column;
+   }
+
+   /**
+    * Set the source location range of an AST node using two location nodes
+    *
+    * \sa ast_node::set_location
+    */
+   void set_location_range(const struct YYLTYPE &begin, const struct YYLTYPE &end)
+   {
+      this->location.source = begin.source;
+      this->location.first_line = begin.first_line;
+      this->location.last_line = end.last_line;
+      this->location.first_column = begin.first_column;
+      this->location.last_column = end.last_column;
+   }
+
+   /**
+    * Source location of the AST node.
+    */
+   struct {
+      unsigned source;          /**< GLSL source number. */
+      unsigned first_line;      /**< First line number within the source string. */
+      unsigned first_column;    /**< First column in the first line. */
+      unsigned last_line;       /**< Last line number within the source string. */
+      unsigned last_column;     /**< Last column in the last line. */
+   } location;
+
+   exec_node link;
+
+protected:
+   /**
+    * The only constructor is protected so that only derived class objects can
+    * be created.
+    */
+   ast_node(void);
+};
+
+
+/**
+ * Operators for AST expression nodes.
+ */
+enum ast_operators {
+   ast_assign,
+   ast_plus,        /**< Unary + operator. */
+   ast_neg,
+   ast_add,
+   ast_sub,
+   ast_mul,
+   ast_div,
+   ast_mod,
+   ast_lshift,
+   ast_rshift,
+   ast_less,
+   ast_greater,
+   ast_lequal,
+   ast_gequal,
+   ast_equal,
+   ast_nequal,
+   ast_bit_and,
+   ast_bit_xor,
+   ast_bit_or,
+   ast_bit_not,
+   ast_logic_and,
+   ast_logic_xor,
+   ast_logic_or,
+   ast_logic_not,
+
+   ast_mul_assign,
+   ast_div_assign,
+   ast_mod_assign,
+   ast_add_assign,
+   ast_sub_assign,
+   ast_ls_assign,
+   ast_rs_assign,
+   ast_and_assign,
+   ast_xor_assign,
+   ast_or_assign,
+
+   ast_conditional,
+
+   ast_pre_inc,
+   ast_pre_dec,
+   ast_post_inc,
+   ast_post_dec,
+   ast_field_selection,
+   ast_array_index,
+   ast_unsized_array_dim,
+
+   ast_function_call,
+
+   ast_identifier,
+   ast_int_constant,
+   ast_uint_constant,
+   ast_float_constant,
+   ast_bool_constant,
+   ast_double_constant,
+
+   ast_sequence,
+   ast_aggregate
+};
+
+/**
+ * Representation of any sort of expression.
+ */
+class ast_expression : public ast_node {
+public:
+   ast_expression(int oper, ast_expression *,
+                 ast_expression *, ast_expression *);
+
+   ast_expression(const char *identifier) :
+      oper(ast_identifier)
+   {
+      subexpressions[0] = NULL;
+      subexpressions[1] = NULL;
+      subexpressions[2] = NULL;
+      primary_expression.identifier = identifier;
+      this->non_lvalue_description = NULL;
+   }
+
+   static const char *operator_string(enum ast_operators op);
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   virtual void hir_no_rvalue(exec_list *instructions,
+                              struct _mesa_glsl_parse_state *state);
+
+   virtual bool has_sequence_subexpression() const;
+
+   ir_rvalue *do_hir(exec_list *instructions,
+                     struct _mesa_glsl_parse_state *state,
+                     bool needs_rvalue);
+
+   virtual void print(void) const;
+
+   enum ast_operators oper;
+
+   ast_expression *subexpressions[3];
+
+   union {
+      const char *identifier;
+      int int_constant;
+      float float_constant;
+      unsigned uint_constant;
+      int bool_constant;
+      double double_constant;
+   } primary_expression;
+
+
+   /**
+    * List of expressions for an \c ast_sequence or parameters for an
+    * \c ast_function_call
+    */
+   exec_list expressions;
+
+   /**
+    * For things that can't be l-values, this describes what it is.
+    *
+    * This text is used by the code that generates IR for assignments to
+    * detect and emit useful messages for assignments to some things that
+    * can't be l-values.  For example, pre- or post-incerement expressions.
+    *
+    * \note
+    * This pointer may be \c NULL.
+    */
+   const char *non_lvalue_description;
+};
+
+class ast_expression_bin : public ast_expression {
+public:
+   ast_expression_bin(int oper, ast_expression *, ast_expression *);
+
+   virtual void print(void) const;
+};
+
+/**
+ * Subclass of expressions for function calls
+ */
+class ast_function_expression : public ast_expression {
+public:
+   ast_function_expression(ast_expression *callee)
+      : ast_expression(ast_function_call, callee,
+                      NULL, NULL),
+       cons(false)
+   {
+      /* empty */
+   }
+
+   ast_function_expression(class ast_type_specifier *type)
+      : ast_expression(ast_function_call, (ast_expression *) type,
+                      NULL, NULL),
+       cons(true)
+   {
+      /* empty */
+   }
+
+   bool is_constructor() const
+   {
+      return cons;
+   }
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   virtual void hir_no_rvalue(exec_list *instructions,
+                              struct _mesa_glsl_parse_state *state);
+
+   virtual bool has_sequence_subexpression() const;
+
+private:
+   /**
+    * Is this function call actually a constructor?
+    */
+   bool cons;
+   ir_rvalue *
+   handle_method(exec_list *instructions,
+                 struct _mesa_glsl_parse_state *state);
+};
+
+class ast_subroutine_list : public ast_node
+{
+public:
+   virtual void print(void) const;
+   exec_list declarations;
+};
+
+class ast_array_specifier : public ast_node {
+public:
+   ast_array_specifier(const struct YYLTYPE &locp, ast_expression *dim)
+   {
+      set_location(locp);
+      array_dimensions.push_tail(&dim->link);
+   }
+
+   void add_dimension(ast_expression *dim)
+   {
+      array_dimensions.push_tail(&dim->link);
+   }
+
+   bool is_single_dimension() const
+   {
+      return this->array_dimensions.tail_pred->prev != NULL &&
+             this->array_dimensions.tail_pred->prev->is_head_sentinel();
+   }
+
+   virtual void print(void) const;
+
+   /* This list contains objects of type ast_node containing the
+    * array dimensions in outermost-to-innermost order.
+    */
+   exec_list array_dimensions;
+};
+
+class ast_layout_expression : public ast_node {
+public:
+   ast_layout_expression(const struct YYLTYPE &locp, ast_expression *expr)
+   {
+      set_location(locp);
+      layout_const_expressions.push_tail(&expr->link);
+   }
+
+   bool process_qualifier_constant(struct _mesa_glsl_parse_state *state,
+                                   const char *qual_indentifier,
+                                   unsigned *value, bool can_be_zero);
+
+   void merge_qualifier(ast_layout_expression *l_expr)
+   {
+      layout_const_expressions.append_list(&l_expr->layout_const_expressions);
+   }
+
+   exec_list layout_const_expressions;
+};
+
+/**
+ * C-style aggregate initialization class
+ *
+ * Represents C-style initializers of vectors, matrices, arrays, and
+ * structures. E.g., vec3 pos = {1.0, 0.0, -1.0} is equivalent to
+ * vec3 pos = vec3(1.0, 0.0, -1.0).
+ *
+ * Specified in GLSL 4.20 and GL_ARB_shading_language_420pack.
+ *
+ * \sa _mesa_ast_set_aggregate_type
+ */
+class ast_aggregate_initializer : public ast_expression {
+public:
+   ast_aggregate_initializer()
+      : ast_expression(ast_aggregate, NULL, NULL, NULL),
+        constructor_type(NULL)
+   {
+      /* empty */
+   }
+
+   /**
+    * glsl_type of the aggregate, which is inferred from the LHS of whatever
+    * the aggregate is being used to initialize.  This can't be inferred at
+    * parse time (since the parser deals with ast_type_specifiers, not
+    * glsl_types), so the parser leaves it NULL.  However, the ast-to-hir
+    * conversion code makes sure to fill it in with the appropriate type
+    * before hir() is called.
+    */
+   const glsl_type *constructor_type;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                          struct _mesa_glsl_parse_state *state);
+
+   virtual void hir_no_rvalue(exec_list *instructions,
+                              struct _mesa_glsl_parse_state *state);
+};
+
+/**
+ * Number of possible operators for an ast_expression
+ *
+ * This is done as a define instead of as an additional value in the enum so
+ * that the compiler won't generate spurious messages like "warning:
+ * enumeration value ‘ast_num_operators’ not handled in switch"
+ */
+#define AST_NUM_OPERATORS (ast_sequence + 1)
+
+
+class ast_compound_statement : public ast_node {
+public:
+   ast_compound_statement(int new_scope, ast_node *statements);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   int new_scope;
+   exec_list statements;
+};
+
+class ast_declaration : public ast_node {
+public:
+   ast_declaration(const char *identifier,
+                   ast_array_specifier *array_specifier,
+                   ast_expression *initializer);
+   virtual void print(void) const;
+
+   const char *identifier;
+
+   ast_array_specifier *array_specifier;
+
+   ast_expression *initializer;
+};
+
+
+enum {
+   ast_precision_none = 0, /**< Absence of precision qualifier. */
+   ast_precision_high,
+   ast_precision_medium,
+   ast_precision_low
+};
+
+struct ast_type_qualifier {
+   DECLARE_RALLOC_CXX_OPERATORS(ast_type_qualifier);
+
+   union {
+      struct {
+        unsigned invariant:1;
+         unsigned precise:1;
+        unsigned constant:1;
+        unsigned attribute:1;
+        unsigned varying:1;
+        unsigned in:1;
+        unsigned out:1;
+        unsigned centroid:1;
+         unsigned sample:1;
+        unsigned patch:1;
+        unsigned uniform:1;
+        unsigned buffer:1;
+        unsigned shared_storage:1;
+        unsigned smooth:1;
+        unsigned flat:1;
+        unsigned noperspective:1;
+
+        /** \name Layout qualifiers for GL_ARB_fragment_coord_conventions */
+        /*@{*/
+        unsigned origin_upper_left:1;
+        unsigned pixel_center_integer:1;
+        /*@}*/
+
+        /**
+         * Flag set if GL_ARB_explicit_attrib_location "location" layout
+         * qualifier is used.
+         */
+        unsigned explicit_location:1;
+        /**
+         * Flag set if GL_ARB_explicit_attrib_location "index" layout
+         * qualifier is used.
+         */
+        unsigned explicit_index:1;
+
+         /**
+          * Flag set if GL_ARB_shading_language_420pack "binding" layout
+          * qualifier is used.
+          */
+         unsigned explicit_binding:1;
+
+         /**
+          * Flag set if GL_ARB_shader_atomic counter "offset" layout
+          * qualifier is used.
+          */
+         unsigned explicit_offset:1;
+
+         /** \name Layout qualifiers for GL_AMD_conservative_depth */
+         /** \{ */
+         unsigned depth_any:1;
+         unsigned depth_greater:1;
+         unsigned depth_less:1;
+         unsigned depth_unchanged:1;
+         /** \} */
+
+        /** \name Layout qualifiers for GL_ARB_uniform_buffer_object */
+        /** \{ */
+         unsigned std140:1;
+         unsigned std430:1;
+         unsigned shared:1;
+         unsigned packed:1;
+         unsigned column_major:1;
+         unsigned row_major:1;
+        /** \} */
+
+        /** \name Layout qualifiers for GLSL 1.50 geometry shaders */
+        /** \{ */
+        unsigned prim_type:1;
+        unsigned max_vertices:1;
+        /** \} */
+
+         /**
+          * local_size_{x,y,z} flags for compute shaders.  Bit 0 represents
+          * local_size_x, and so on.
+          */
+         unsigned local_size:3;
+
+        /** \name Layout and memory qualifiers for ARB_shader_image_load_store. */
+        /** \{ */
+        unsigned early_fragment_tests:1;
+        unsigned explicit_image_format:1;
+        unsigned coherent:1;
+        unsigned _volatile:1;
+        unsigned restrict_flag:1;
+        unsigned read_only:1; /**< "readonly" qualifier. */
+        unsigned write_only:1; /**< "writeonly" qualifier. */
+        /** \} */
+
+         /** \name Layout qualifiers for GL_ARB_gpu_shader5 */
+         /** \{ */
+         unsigned invocations:1;
+         unsigned stream:1; /**< Has stream value assigned  */
+         unsigned explicit_stream:1; /**< stream value assigned explicitly by shader code */
+         /** \} */
+
+        /** \name Layout qualifiers for GL_ARB_tessellation_shader */
+        /** \{ */
+        /* tess eval input layout */
+        /* gs prim_type reused for primitive mode */
+        unsigned vertex_spacing:1;
+        unsigned ordering:1;
+        unsigned point_mode:1;
+        /* tess control output layout */
+        unsigned vertices:1;
+        /** \} */
+
+         /** \name Qualifiers for GL_ARB_shader_subroutine */
+        /** \{ */
+         unsigned subroutine:1;  /**< Is this marked 'subroutine' */
+         unsigned subroutine_def:1; /**< Is this marked 'subroutine' with a list of types */
+        /** \} */
+      }
+      /** \brief Set of flags, accessed by name. */
+      q;
+
+      /** \brief Set of flags, accessed as a bitmask. */
+      uint64_t i;
+   } flags;
+
+   /** Precision of the type (highp/medium/lowp). */
+   unsigned precision:2;
+
+   /** Geometry shader invocations for GL_ARB_gpu_shader5. */
+   ast_layout_expression *invocations;
+
+   /**
+    * Location specified via GL_ARB_explicit_attrib_location layout
+    *
+    * \note
+    * This field is only valid if \c explicit_location is set.
+    */
+   ast_expression *location;
+   /**
+    * Index specified via GL_ARB_explicit_attrib_location layout
+    *
+    * \note
+    * This field is only valid if \c explicit_index is set.
+    */
+   ast_expression *index;
+
+   /** Maximum output vertices in GLSL 1.50 geometry shaders. */
+   ast_layout_expression *max_vertices;
+
+   /** Stream in GLSL 1.50 geometry shaders. */
+   ast_expression *stream;
+
+   /**
+    * Input or output primitive type in GLSL 1.50 geometry shaders
+    * and tessellation shaders.
+    */
+   GLenum prim_type;
+
+   /**
+    * Binding specified via GL_ARB_shading_language_420pack's "binding" keyword.
+    *
+    * \note
+    * This field is only valid if \c explicit_binding is set.
+    */
+   ast_expression *binding;
+
+   /**
+    * Offset specified via GL_ARB_shader_atomic_counter's "offset"
+    * keyword.
+    *
+    * \note
+    * This field is only valid if \c explicit_offset is set.
+    */
+   ast_expression *offset;
+
+   /**
+    * Local size specified via GL_ARB_compute_shader's "local_size_{x,y,z}"
+    * layout qualifier.  Element i of this array is only valid if
+    * flags.q.local_size & (1 << i) is set.
+    */
+   ast_layout_expression *local_size[3];
+
+   /** Tessellation evaluation shader: vertex spacing (equal, fractional even/odd) */
+   GLenum vertex_spacing;
+
+   /** Tessellation evaluation shader: vertex ordering (CW or CCW) */
+   GLenum ordering;
+
+   /** Tessellation evaluation shader: point mode */
+   bool point_mode;
+
+   /** Tessellation control shader: number of output vertices */
+   ast_layout_expression *vertices;
+
+   /**
+    * Image format specified with an ARB_shader_image_load_store
+    * layout qualifier.
+    *
+    * \note
+    * This field is only valid if \c explicit_image_format is set.
+    */
+   GLenum image_format;
+
+   /**
+    * Base type of the data read from or written to this image.  Only
+    * the following enumerants are allowed: GLSL_TYPE_UINT,
+    * GLSL_TYPE_INT, GLSL_TYPE_FLOAT.
+    *
+    * \note
+    * This field is only valid if \c explicit_image_format is set.
+    */
+   glsl_base_type image_base_type;
+
+   /** Flag to know if this represents a default value for a qualifier */
+   bool is_default_qualifier;
+
+   /**
+    * Return true if and only if an interpolation qualifier is present.
+    */
+   bool has_interpolation() const;
+
+   /**
+    * Return whether a layout qualifier is present.
+    */
+   bool has_layout() const;
+
+   /**
+    * Return whether a storage qualifier is present.
+    */
+   bool has_storage() const;
+
+   /**
+    * Return whether an auxiliary storage qualifier is present.
+    */
+   bool has_auxiliary_storage() const;
+
+   /**
+    * \brief Return string representation of interpolation qualifier.
+    *
+    * If an interpolation qualifier is present, then return that qualifier's
+    * string representation. Otherwise, return null. For example, if the
+    * noperspective bit is set, then this returns "noperspective".
+    *
+    * If multiple interpolation qualifiers are somehow present, then the
+    * returned string is undefined but not null.
+    */
+   const char *interpolation_string() const;
+
+   bool merge_qualifier(YYLTYPE *loc,
+                       _mesa_glsl_parse_state *state,
+                        const ast_type_qualifier &q,
+                        bool is_single_layout_merge);
+
+   bool merge_out_qualifier(YYLTYPE *loc,
+                           _mesa_glsl_parse_state *state,
+                           const ast_type_qualifier &q,
+                           ast_node* &node, bool create_node);
+
+   bool merge_in_qualifier(YYLTYPE *loc,
+                           _mesa_glsl_parse_state *state,
+                           const ast_type_qualifier &q,
+                           ast_node* &node, bool create_node);
+
+   ast_subroutine_list *subroutine_list;
+};
+
+class ast_declarator_list;
+
+class ast_struct_specifier : public ast_node {
+public:
+   ast_struct_specifier(const char *identifier,
+                       ast_declarator_list *declarator_list);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   const char *name;
+   ast_type_qualifier *layout;
+   /* List of ast_declarator_list * */
+   exec_list declarations;
+   bool is_declaration;
+};
+
+
+
+class ast_type_specifier : public ast_node {
+public:
+   /** Construct a type specifier from a type name */
+   ast_type_specifier(const char *name) 
+      : type_name(name), structure(NULL), array_specifier(NULL),
+       default_precision(ast_precision_none)
+   {
+      /* empty */
+   }
+
+   /** Construct a type specifier from a structure definition */
+   ast_type_specifier(ast_struct_specifier *s)
+      : type_name(s->name), structure(s), array_specifier(NULL),
+       default_precision(ast_precision_none)
+   {
+      /* empty */
+   }
+
+   const struct glsl_type *glsl_type(const char **name,
+                                    struct _mesa_glsl_parse_state *state)
+      const;
+
+   virtual void print(void) const;
+
+   ir_rvalue *hir(exec_list *, struct _mesa_glsl_parse_state *);
+
+   const char *type_name;
+   ast_struct_specifier *structure;
+
+   ast_array_specifier *array_specifier;
+
+   /** For precision statements, this is the given precision; otherwise none. */
+   unsigned default_precision:2;
+};
+
+
+class ast_fully_specified_type : public ast_node {
+public:
+   virtual void print(void) const;
+   bool has_qualifiers(_mesa_glsl_parse_state *state) const;
+
+   ast_fully_specified_type() : qualifier(), specifier(NULL)
+   {
+   }
+
+   const struct glsl_type *glsl_type(const char **name,
+                                    struct _mesa_glsl_parse_state *state)
+      const;
+
+   ast_type_qualifier qualifier;
+   ast_type_specifier *specifier;
+};
+
+
+class ast_declarator_list : public ast_node {
+public:
+   ast_declarator_list(ast_fully_specified_type *);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_fully_specified_type *type;
+   /** List of 'ast_declaration *' */
+   exec_list declarations;
+
+   /**
+    * Flags for redeclarations. In these cases, no type is specified, to
+    * `type` is allowed to be NULL. In all other cases, this would be an error.
+    */
+   int invariant;     /** < `invariant` redeclaration */
+   int precise;       /** < `precise` redeclaration */
+};
+
+
+class ast_parameter_declarator : public ast_node {
+public:
+   ast_parameter_declarator() :
+      type(NULL),
+      identifier(NULL),
+      array_specifier(NULL),
+      formal_parameter(false),
+      is_void(false)
+   {
+      /* empty */
+   }
+
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_fully_specified_type *type;
+   const char *identifier;
+   ast_array_specifier *array_specifier;
+
+   static void parameters_to_hir(exec_list *ast_parameters,
+                                bool formal, exec_list *ir_parameters,
+                                struct _mesa_glsl_parse_state *state);
+
+private:
+   /** Is this parameter declaration part of a formal parameter list? */
+   bool formal_parameter;
+
+   /**
+    * Is this parameter 'void' type?
+    *
+    * This field is set by \c ::hir.
+    */
+   bool is_void;
+};
+
+
+class ast_function : public ast_node {
+public:
+   ast_function(void);
+
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_fully_specified_type *return_type;
+   const char *identifier;
+
+   exec_list parameters;
+
+private:
+   /**
+    * Is this prototype part of the function definition?
+    *
+    * Used by ast_function_definition::hir to process the parameters, etc.
+    * of the function.
+    *
+    * \sa ::hir
+    */
+   bool is_definition;
+
+   /**
+    * Function signature corresponding to this function prototype instance
+    *
+    * Used by ast_function_definition::hir to process the parameters, etc.
+    * of the function.
+    *
+    * \sa ::hir
+    */
+   class ir_function_signature *signature;
+
+   friend class ast_function_definition;
+};
+
+
+class ast_expression_statement : public ast_node {
+public:
+   ast_expression_statement(ast_expression *);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_expression *expression;
+};
+
+
+class ast_case_label : public ast_node {
+public:
+   ast_case_label(ast_expression *test_value);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   /**
+    * An test value of NULL means 'default'.
+    */
+   ast_expression *test_value;
+};
+
+
+class ast_case_label_list : public ast_node {
+public:
+   ast_case_label_list(void);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   /**
+    * A list of case labels.
+    */
+   exec_list labels;
+};
+
+
+class ast_case_statement : public ast_node {
+public:
+   ast_case_statement(ast_case_label_list *labels);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_case_label_list *labels;
+
+   /**
+    * A list of statements.
+    */
+   exec_list stmts;
+};
+
+
+class ast_case_statement_list : public ast_node {
+public:
+   ast_case_statement_list(void);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   /**
+    * A list of cases.
+    */
+   exec_list cases;
+};
+
+
+class ast_switch_body : public ast_node {
+public:
+   ast_switch_body(ast_case_statement_list *stmts);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_case_statement_list *stmts;
+};
+
+
+class ast_selection_statement : public ast_node {
+public:
+   ast_selection_statement(ast_expression *condition,
+                          ast_node *then_statement,
+                          ast_node *else_statement);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_expression *condition;
+   ast_node *then_statement;
+   ast_node *else_statement;
+};
+
+
+class ast_switch_statement : public ast_node {
+public:
+   ast_switch_statement(ast_expression *test_expression,
+                       ast_node *body);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_expression *test_expression;
+   ast_node *body;
+
+protected:
+   void test_to_hir(exec_list *, struct _mesa_glsl_parse_state *);
+};
+
+class ast_iteration_statement : public ast_node {
+public:
+   ast_iteration_statement(int mode, ast_node *init, ast_node *condition,
+                          ast_expression *rest_expression, ast_node *body);
+
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *, struct _mesa_glsl_parse_state *);
+
+   enum ast_iteration_modes {
+      ast_for,
+      ast_while,
+      ast_do_while
+   } mode;
+   
+
+   ast_node *init_statement;
+   ast_node *condition;
+   ast_expression *rest_expression;
+
+   ast_node *body;
+
+   /**
+    * Generate IR from the condition of a loop
+    *
+    * This is factored out of ::hir because some loops have the condition
+    * test at the top (for and while), and others have it at the end (do-while).
+    */
+   void condition_to_hir(exec_list *, struct _mesa_glsl_parse_state *);
+};
+
+
+class ast_jump_statement : public ast_node {
+public:
+   ast_jump_statement(int mode, ast_expression *return_value);
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   enum ast_jump_modes {
+      ast_continue,
+      ast_break,
+      ast_return,
+      ast_discard
+   } mode;
+
+   ast_expression *opt_return_value;
+};
+
+
+class ast_function_definition : public ast_node {
+public:
+   ast_function_definition() : prototype(NULL), body(NULL)
+   {
+   }
+
+   virtual void print(void) const;
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_function *prototype;
+   ast_compound_statement *body;
+};
+
+class ast_interface_block : public ast_node {
+public:
+   ast_interface_block(ast_type_qualifier layout,
+                       const char *instance_name,
+                       ast_array_specifier *array_specifier)
+   : layout(layout), block_name(NULL), instance_name(instance_name),
+     array_specifier(array_specifier)
+   {
+   }
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                         struct _mesa_glsl_parse_state *state);
+
+   ast_type_qualifier layout;
+   const char *block_name;
+
+   /**
+    * Declared name of the block instance, if specified.
+    *
+    * If the block does not have an instance name, this field will be
+    * \c NULL.
+    */
+   const char *instance_name;
+
+   /** List of ast_declarator_list * */
+   exec_list declarations;
+
+   /**
+    * Declared array size of the block instance
+    *
+    * If the block is not declared as an array or if the block instance array
+    * is unsized, this field will be \c NULL.
+    */
+   ast_array_specifier *array_specifier;
+};
+
+
+/**
+ * AST node representing a declaration of the output layout for tessellation
+ * control shaders.
+ */
+class ast_tcs_output_layout : public ast_node
+{
+public:
+   ast_tcs_output_layout(const struct YYLTYPE &locp)
+   {
+      set_location(locp);
+   }
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                          struct _mesa_glsl_parse_state *state);
+};
+
+
+/**
+ * AST node representing a declaration of the input layout for geometry
+ * shaders.
+ */
+class ast_gs_input_layout : public ast_node
+{
+public:
+   ast_gs_input_layout(const struct YYLTYPE &locp, GLenum prim_type)
+      : prim_type(prim_type)
+   {
+      set_location(locp);
+   }
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                          struct _mesa_glsl_parse_state *state);
+
+private:
+   const GLenum prim_type;
+};
+
+
+/**
+ * AST node representing a decalaration of the input layout for compute
+ * shaders.
+ */
+class ast_cs_input_layout : public ast_node
+{
+public:
+   ast_cs_input_layout(const struct YYLTYPE &locp,
+                       ast_layout_expression *const *local_size)
+   {
+      for (int i = 0; i < 3; i++) {
+         this->local_size[i] = local_size[i];
+      }
+      set_location(locp);
+   }
+
+   virtual ir_rvalue *hir(exec_list *instructions,
+                          struct _mesa_glsl_parse_state *state);
+
+private:
+   ast_layout_expression *local_size[3];
+};
+
+/*@}*/
+
+extern void
+_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state);
+
+extern ir_rvalue *
+_mesa_ast_field_selection_to_hir(const ast_expression *expr,
+                                exec_list *instructions,
+                                struct _mesa_glsl_parse_state *state);
+
+extern ir_rvalue *
+_mesa_ast_array_index_to_hir(void *mem_ctx,
+                            struct _mesa_glsl_parse_state *state,
+                            ir_rvalue *array, ir_rvalue *idx,
+                            YYLTYPE &loc, YYLTYPE &idx_loc);
+
+extern void
+_mesa_ast_set_aggregate_type(const glsl_type *type,
+                             ast_expression *expr);
+
+void
+emit_function(_mesa_glsl_parse_state *state, ir_function *f);
+
+extern void
+check_builtin_array_max_size(const char *name, unsigned size,
+                             YYLTYPE loc, struct _mesa_glsl_parse_state *state);
+
+extern void _mesa_ast_process_interface_block(YYLTYPE *locp,
+                                              _mesa_glsl_parse_state *state,
+                                              ast_interface_block *const block,
+                                              const struct ast_type_qualifier &q);
+
+#endif /* AST_H */
diff --git a/src/compiler/glsl/ast_array_index.cpp b/src/compiler/glsl/ast_array_index.cpp
new file mode 100644 (file)
index 0000000..f5baeb9
--- /dev/null
@@ -0,0 +1,333 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "ast.h"
+#include "compiler/glsl_types.h"
+#include "ir.h"
+
+void
+ast_array_specifier::print(void) const
+{
+   foreach_list_typed (ast_node, array_dimension, link, &this->array_dimensions) {
+      printf("[ ");
+      if (((ast_expression*)array_dimension)->oper != ast_unsized_array_dim)
+         array_dimension->print();
+      printf("] ");
+   }
+}
+
+/**
+ * If \c ir is a reference to an array for which we are tracking the max array
+ * element accessed, track that the given element has been accessed.
+ * Otherwise do nothing.
+ *
+ * This function also checks whether the array is a built-in array whose
+ * maximum size is too small to accommodate the given index, and if so uses
+ * loc and state to report the error.
+ */
+static void
+update_max_array_access(ir_rvalue *ir, int idx, YYLTYPE *loc,
+                        struct _mesa_glsl_parse_state *state)
+{
+   if (ir_dereference_variable *deref_var = ir->as_dereference_variable()) {
+      ir_variable *var = deref_var->var;
+      if (idx > (int)var->data.max_array_access) {
+         var->data.max_array_access = idx;
+
+         /* Check whether this access will, as a side effect, implicitly cause
+          * the size of a built-in array to be too large.
+          */
+         check_builtin_array_max_size(var->name, idx+1, *loc, state);
+      }
+   } else if (ir_dereference_record *deref_record =
+              ir->as_dereference_record()) {
+      /* There are three possibilities we need to consider:
+       *
+       * - Accessing an element of an array that is a member of a named
+       *   interface block (e.g. ifc.foo[i])
+       *
+       * - Accessing an element of an array that is a member of a named
+       *   interface block array (e.g. ifc[j].foo[i]).
+       *
+       * - Accessing an element of an array that is a member of a named
+       *   interface block array of arrays (e.g. ifc[j][k].foo[i]).
+       */
+      ir_dereference_variable *deref_var =
+         deref_record->record->as_dereference_variable();
+      if (deref_var == NULL) {
+         ir_dereference_array *deref_array =
+            deref_record->record->as_dereference_array();
+         ir_dereference_array *deref_array_prev = NULL;
+         while (deref_array != NULL) {
+            deref_array_prev = deref_array;
+            deref_array = deref_array->array->as_dereference_array();
+         }
+         if (deref_array_prev != NULL)
+            deref_var = deref_array_prev->array->as_dereference_variable();
+      }
+
+      if (deref_var != NULL) {
+         if (deref_var->var->is_interface_instance()) {
+            unsigned field_index =
+               deref_record->record->type->field_index(deref_record->field);
+            assert(field_index < deref_var->var->get_interface_type()->length);
+
+            unsigned *const max_ifc_array_access =
+               deref_var->var->get_max_ifc_array_access();
+
+            assert(max_ifc_array_access != NULL);
+
+            if (idx > (int)max_ifc_array_access[field_index]) {
+               max_ifc_array_access[field_index] = idx;
+
+               /* Check whether this access will, as a side effect, implicitly
+                * cause the size of a built-in array to be too large.
+                */
+               check_builtin_array_max_size(deref_record->field, idx+1, *loc,
+                                            state);
+            }
+         }
+      }
+   }
+}
+
+
+static int
+get_implicit_array_size(struct _mesa_glsl_parse_state *state,
+                        ir_rvalue *array)
+{
+   ir_variable *var = array->variable_referenced();
+
+   /* Inputs in control shader are implicitly sized
+    * to the maximum patch size.
+    */
+   if (state->stage == MESA_SHADER_TESS_CTRL &&
+       var->data.mode == ir_var_shader_in) {
+      return state->Const.MaxPatchVertices;
+   }
+
+   /* Non-patch inputs in evaluation shader are implicitly sized
+    * to the maximum patch size.
+    */
+   if (state->stage == MESA_SHADER_TESS_EVAL &&
+       var->data.mode == ir_var_shader_in &&
+       !var->data.patch) {
+      return state->Const.MaxPatchVertices;
+   }
+
+   return 0;
+}
+
+
+ir_rvalue *
+_mesa_ast_array_index_to_hir(void *mem_ctx,
+                            struct _mesa_glsl_parse_state *state,
+                            ir_rvalue *array, ir_rvalue *idx,
+                            YYLTYPE &loc, YYLTYPE &idx_loc)
+{
+   if (!array->type->is_error()
+       && !array->type->is_array()
+       && !array->type->is_matrix()
+       && !array->type->is_vector()) {
+      _mesa_glsl_error(& idx_loc, state,
+                      "cannot dereference non-array / non-matrix / "
+                      "non-vector");
+   }
+
+   if (!idx->type->is_error()) {
+      if (!idx->type->is_integer()) {
+        _mesa_glsl_error(& idx_loc, state, "array index must be integer type");
+      } else if (!idx->type->is_scalar()) {
+        _mesa_glsl_error(& idx_loc, state, "array index must be scalar");
+      }
+   }
+
+   /* If the array index is a constant expression and the array has a
+    * declared size, ensure that the access is in-bounds.  If the array
+    * index is not a constant expression, ensure that the array has a
+    * declared size.
+    */
+   ir_constant *const const_index = idx->constant_expression_value();
+   if (const_index != NULL && idx->type->is_integer()) {
+      const int idx = const_index->value.i[0];
+      const char *type_name = "error";
+      unsigned bound = 0;
+
+      /* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec:
+       *
+       *    "It is illegal to declare an array with a size, and then
+       *    later (in the same shader) index the same array with an
+       *    integral constant expression greater than or equal to the
+       *    declared size. It is also illegal to index an array with a
+       *    negative constant expression."
+       */
+      if (array->type->is_matrix()) {
+        if (array->type->row_type()->vector_elements <= idx) {
+           type_name = "matrix";
+           bound = array->type->row_type()->vector_elements;
+        }
+      } else if (array->type->is_vector()) {
+        if (array->type->vector_elements <= idx) {
+           type_name = "vector";
+           bound = array->type->vector_elements;
+        }
+      } else {
+        /* glsl_type::array_size() returns -1 for non-array types.  This means
+         * that we don't need to verify that the type is an array before
+         * doing the bounds checking.
+         */
+        if ((array->type->array_size() > 0)
+            && (array->type->array_size() <= idx)) {
+           type_name = "array";
+           bound = array->type->array_size();
+        }
+      }
+
+      if (bound > 0) {
+        _mesa_glsl_error(& loc, state, "%s index must be < %u",
+                         type_name, bound);
+      } else if (idx < 0) {
+        _mesa_glsl_error(& loc, state, "%s index must be >= 0",
+                         type_name);
+      }
+
+      if (array->type->is_array())
+         update_max_array_access(array, idx, &loc, state);
+   } else if (const_index == NULL && array->type->is_array()) {
+      if (array->type->is_unsized_array()) {
+         int implicit_size = get_implicit_array_size(state, array);
+         if (implicit_size) {
+            ir_variable *v = array->whole_variable_referenced();
+            if (v != NULL)
+               v->data.max_array_access = implicit_size - 1;
+         }
+         else if (state->stage == MESA_SHADER_TESS_CTRL &&
+                  array->variable_referenced()->data.mode == ir_var_shader_out &&
+                  !array->variable_referenced()->data.patch) {
+            /* Tessellation control shader output non-patch arrays are
+             * initially unsized. Despite that, they are allowed to be
+             * indexed with a non-constant expression (typically
+             * "gl_InvocationID"). The array size will be determined
+             * by the linker.
+             */
+         }
+         else if (array->variable_referenced()->data.mode !=
+                  ir_var_shader_storage) {
+            _mesa_glsl_error(&loc, state, "unsized array index must be constant");
+         }
+      } else if (array->type->without_array()->is_interface()
+                 && (array->variable_referenced()->data.mode == ir_var_uniform ||
+                     array->variable_referenced()->data.mode == ir_var_shader_storage)
+                 && !state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
+        /* Page 50 in section 4.3.9 of the OpenGL ES 3.10 spec says:
+         *
+         *     "All indices used to index a uniform or shader storage block
+         *     array must be constant integral expressions."
+         */
+        _mesa_glsl_error(&loc, state, "%s block array index must be constant",
+                          array->variable_referenced()->data.mode
+                          == ir_var_uniform ? "uniform" : "shader storage");
+      } else {
+        /* whole_variable_referenced can return NULL if the array is a
+         * member of a structure.  In this case it is safe to not update
+         * the max_array_access field because it is never used for fields
+         * of structures.
+         */
+        ir_variable *v = array->whole_variable_referenced();
+        if (v != NULL)
+           v->data.max_array_access = array->type->array_size() - 1;
+      }
+
+      /* From page 23 (29 of the PDF) of the GLSL 1.30 spec:
+       *
+       *    "Samplers aggregated into arrays within a shader (using square
+       *    brackets [ ]) can only be indexed with integral constant
+       *    expressions [...]."
+       *
+       * This restriction was added in GLSL 1.30.  Shaders using earlier
+       * version of the language should not be rejected by the compiler
+       * front-end for using this construct.  This allows useful things such
+       * as using a loop counter as the index to an array of samplers.  If the
+       * loop in unrolled, the code should compile correctly.  Instead, emit a
+       * warning.
+       *
+       * In GLSL 4.00 / ARB_gpu_shader5, this requirement is relaxed again to allow
+       * indexing with dynamically uniform expressions. Note that these are not
+       * required to be uniforms or expressions based on them, but merely that the
+       * values must not diverge between shader invocations run together. If the
+       * values *do* diverge, then the behavior of the operation requiring a
+       * dynamically uniform expression is undefined.
+       */
+      if (array->type->without_array()->is_sampler()) {
+         if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
+            if (state->is_version(130, 300))
+               _mesa_glsl_error(&loc, state,
+                                "sampler arrays indexed with non-constant "
+                                "expressions are forbidden in GLSL %s "
+                                "and later",
+                                state->es_shader ? "ES 3.00" : "1.30");
+            else if (state->es_shader)
+               _mesa_glsl_warning(&loc, state,
+                                  "sampler arrays indexed with non-constant "
+                                  "expressions will be forbidden in GLSL "
+                                  "3.00 and later");
+            else
+               _mesa_glsl_warning(&loc, state,
+                                  "sampler arrays indexed with non-constant "
+                                  "expressions will be forbidden in GLSL "
+                                  "1.30 and later");
+         }
+      }
+
+      /* From page 27 of the GLSL ES 3.1 specification:
+       *
+       * "When aggregated into arrays within a shader, images can only be
+       *  indexed with a constant integral expression."
+       *
+       * On the other hand the desktop GL specification extension allows
+       * non-constant indexing of image arrays, but behavior is left undefined
+       * in cases where the indexing expression is not dynamically uniform.
+       */
+      if (state->es_shader && array->type->without_array()->is_image()) {
+         _mesa_glsl_error(&loc, state,
+                          "image arrays indexed with non-constant "
+                          "expressions are forbidden in GLSL ES.");
+      }
+   }
+
+   /* After performing all of the error checking, generate the IR for the
+    * expression.
+    */
+   if (array->type->is_array()
+       || array->type->is_matrix()
+       || array->type->is_vector()) {
+      return new(mem_ctx) ir_dereference_array(array, idx);
+   } else if (array->type->is_error()) {
+      return array;
+   } else {
+      ir_rvalue *result = new(mem_ctx) ir_dereference_array(array, idx);
+      result->type = glsl_type::error_type;
+
+      return result;
+   }
+}
diff --git a/src/compiler/glsl/ast_expr.cpp b/src/compiler/glsl/ast_expr.cpp
new file mode 100644 (file)
index 0000000..e624d11
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+#include <assert.h>
+#include "ast.h"
+
+const char *
+ast_expression::operator_string(enum ast_operators op)
+{
+   static const char *const operators[] = {
+      "=",
+      "+",
+      "-",
+      "+",
+      "-",
+      "*",
+      "/",
+      "%",
+      "<<",
+      ">>",
+      "<",
+      ">",
+      "<=",
+      ">=",
+      "==",
+      "!=",
+      "&",
+      "^",
+      "|",
+      "~",
+      "&&",
+      "^^",
+      "||",
+      "!",
+
+      "*=",
+      "/=",
+      "%=",
+      "+=",
+      "-=",
+      "<<=",
+      ">>=",
+      "&=",
+      "^=",
+      "|=",
+
+      "?:",
+
+      "++",
+      "--",
+      "++",
+      "--",
+      ".",
+   };
+
+   assert((unsigned int)op < sizeof(operators) / sizeof(operators[0]));
+
+   return operators[op];
+}
+
+
+ast_expression_bin::ast_expression_bin(int oper, ast_expression *ex0,
+                                      ast_expression *ex1) :
+   ast_expression(oper, ex0, ex1, NULL)
+{
+   assert((oper >= ast_plus) && (oper <= ast_logic_not));
+}
+
+
+void
+ast_expression_bin::print(void) const
+{
+   subexpressions[0]->print();
+   printf("%s ", operator_string(oper));
+   subexpressions[1]->print();
+}
diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
new file mode 100644 (file)
index 0000000..0eb456a
--- /dev/null
@@ -0,0 +1,2098 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glsl_symbol_table.h"
+#include "ast.h"
+#include "compiler/glsl_types.h"
+#include "ir.h"
+#include "main/core.h" /* for MIN2 */
+#include "main/shaderobj.h"
+
+static ir_rvalue *
+convert_component(ir_rvalue *src, const glsl_type *desired_type);
+
+bool
+apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
+                          struct _mesa_glsl_parse_state *state);
+
+static unsigned
+process_parameters(exec_list *instructions, exec_list *actual_parameters,
+                  exec_list *parameters,
+                  struct _mesa_glsl_parse_state *state)
+{
+   unsigned count = 0;
+
+   foreach_list_typed(ast_node, ast, link, parameters) {
+      ir_rvalue *result = ast->hir(instructions, state);
+
+      ir_constant *const constant = result->constant_expression_value();
+      if (constant != NULL)
+        result = constant;
+
+      actual_parameters->push_tail(result);
+      count++;
+   }
+
+   return count;
+}
+
+
+/**
+ * Generate a source prototype for a function signature
+ *
+ * \param return_type Return type of the function.  May be \c NULL.
+ * \param name        Name of the function.
+ * \param parameters  List of \c ir_instruction nodes representing the
+ *                    parameter list for the function.  This may be either a
+ *                    formal (\c ir_variable) or actual (\c ir_rvalue)
+ *                    parameter list.  Only the type is used.
+ *
+ * \return
+ * A ralloced string representing the prototype of the function.
+ */
+char *
+prototype_string(const glsl_type *return_type, const char *name,
+                exec_list *parameters)
+{
+   char *str = NULL;
+
+   if (return_type != NULL)
+      str = ralloc_asprintf(NULL, "%s ", return_type->name);
+
+   ralloc_asprintf_append(&str, "%s(", name);
+
+   const char *comma = "";
+   foreach_in_list(const ir_variable, param, parameters) {
+      ralloc_asprintf_append(&str, "%s%s", comma, param->type->name);
+      comma = ", ";
+   }
+
+   ralloc_strcat(&str, ")");
+   return str;
+}
+
+static bool
+verify_image_parameter(YYLTYPE *loc, _mesa_glsl_parse_state *state,
+                       const ir_variable *formal, const ir_variable *actual)
+{
+   /**
+    * From the ARB_shader_image_load_store specification:
+    *
+    * "The values of image variables qualified with coherent,
+    *  volatile, restrict, readonly, or writeonly may not be passed
+    *  to functions whose formal parameters lack such
+    *  qualifiers. [...] It is legal to have additional qualifiers
+    *  on a formal parameter, but not to have fewer."
+    */
+   if (actual->data.image_coherent && !formal->data.image_coherent) {
+      _mesa_glsl_error(loc, state,
+                       "function call parameter `%s' drops "
+                       "`coherent' qualifier", formal->name);
+      return false;
+   }
+
+   if (actual->data.image_volatile && !formal->data.image_volatile) {
+      _mesa_glsl_error(loc, state,
+                       "function call parameter `%s' drops "
+                       "`volatile' qualifier", formal->name);
+      return false;
+   }
+
+   if (actual->data.image_restrict && !formal->data.image_restrict) {
+      _mesa_glsl_error(loc, state,
+                       "function call parameter `%s' drops "
+                       "`restrict' qualifier", formal->name);
+      return false;
+   }
+
+   if (actual->data.image_read_only && !formal->data.image_read_only) {
+      _mesa_glsl_error(loc, state,
+                       "function call parameter `%s' drops "
+                       "`readonly' qualifier", formal->name);
+      return false;
+   }
+
+   if (actual->data.image_write_only && !formal->data.image_write_only) {
+      _mesa_glsl_error(loc, state,
+                       "function call parameter `%s' drops "
+                       "`writeonly' qualifier", formal->name);
+      return false;
+   }
+
+   return true;
+}
+
+static bool
+verify_first_atomic_parameter(YYLTYPE *loc, _mesa_glsl_parse_state *state,
+                                   ir_variable *var)
+{
+   if (!var ||
+       (!var->is_in_shader_storage_block() &&
+        var->data.mode != ir_var_shader_shared)) {
+      _mesa_glsl_error(loc, state, "First argument to atomic function "
+                       "must be a buffer or shared variable");
+      return false;
+   }
+   return true;
+}
+
+static bool
+is_atomic_function(const char *func_name)
+{
+   return !strcmp(func_name, "atomicAdd") ||
+          !strcmp(func_name, "atomicMin") ||
+          !strcmp(func_name, "atomicMax") ||
+          !strcmp(func_name, "atomicAnd") ||
+          !strcmp(func_name, "atomicOr") ||
+          !strcmp(func_name, "atomicXor") ||
+          !strcmp(func_name, "atomicExchange") ||
+          !strcmp(func_name, "atomicCompSwap");
+}
+
+/**
+ * Verify that 'out' and 'inout' actual parameters are lvalues.  Also, verify
+ * that 'const_in' formal parameters (an extension in our IR) correspond to
+ * ir_constant actual parameters.
+ */
+static bool
+verify_parameter_modes(_mesa_glsl_parse_state *state,
+                      ir_function_signature *sig,
+                      exec_list &actual_ir_parameters,
+                      exec_list &actual_ast_parameters)
+{
+   exec_node *actual_ir_node  = actual_ir_parameters.head;
+   exec_node *actual_ast_node = actual_ast_parameters.head;
+
+   foreach_in_list(const ir_variable, formal, &sig->parameters) {
+      /* The lists must be the same length. */
+      assert(!actual_ir_node->is_tail_sentinel());
+      assert(!actual_ast_node->is_tail_sentinel());
+
+      const ir_rvalue *const actual = (ir_rvalue *) actual_ir_node;
+      const ast_expression *const actual_ast =
+        exec_node_data(ast_expression, actual_ast_node, link);
+
+      /* FIXME: 'loc' is incorrect (as of 2011-01-21). It is always
+       * FIXME: 0:0(0).
+       */
+      YYLTYPE loc = actual_ast->get_location();
+
+      /* Verify that 'const_in' parameters are ir_constants. */
+      if (formal->data.mode == ir_var_const_in &&
+         actual->ir_type != ir_type_constant) {
+        _mesa_glsl_error(&loc, state,
+                         "parameter `in %s' must be a constant expression",
+                         formal->name);
+        return false;
+      }
+
+      /* Verify that shader_in parameters are shader inputs */
+      if (formal->data.must_be_shader_input) {
+         ir_variable *var = actual->variable_referenced();
+         if (var && var->data.mode != ir_var_shader_in) {
+            _mesa_glsl_error(&loc, state,
+                             "parameter `%s` must be a shader input",
+                             formal->name);
+            return false;
+         }
+
+         if (actual->ir_type == ir_type_swizzle) {
+            _mesa_glsl_error(&loc, state,
+                             "parameter `%s` must not be swizzled",
+                             formal->name);
+            return false;
+         }
+      }
+
+      /* Verify that 'out' and 'inout' actual parameters are lvalues. */
+      if (formal->data.mode == ir_var_function_out
+          || formal->data.mode == ir_var_function_inout) {
+        const char *mode = NULL;
+        switch (formal->data.mode) {
+        case ir_var_function_out:   mode = "out";   break;
+        case ir_var_function_inout: mode = "inout"; break;
+        default:                    assert(false);  break;
+        }
+
+        /* This AST-based check catches errors like f(i++).  The IR-based
+         * is_lvalue() is insufficient because the actual parameter at the
+         * IR-level is just a temporary value, which is an l-value.
+         */
+        if (actual_ast->non_lvalue_description != NULL) {
+           _mesa_glsl_error(&loc, state,
+                            "function parameter '%s %s' references a %s",
+                            mode, formal->name,
+                            actual_ast->non_lvalue_description);
+           return false;
+        }
+
+        ir_variable *var = actual->variable_referenced();
+        if (var)
+           var->data.assigned = true;
+
+        if (var && var->data.read_only) {
+           _mesa_glsl_error(&loc, state,
+                            "function parameter '%s %s' references the "
+                            "read-only variable '%s'",
+                            mode, formal->name,
+                            actual->variable_referenced()->name);
+           return false;
+        } else if (!actual->is_lvalue()) {
+            _mesa_glsl_error(&loc, state,
+                             "function parameter '%s %s' is not an lvalue",
+                             mode, formal->name);
+            return false;
+        }
+      }
+
+      if (formal->type->is_image() &&
+          actual->variable_referenced()) {
+         if (!verify_image_parameter(&loc, state, formal,
+                                     actual->variable_referenced()))
+            return false;
+      }
+
+      actual_ir_node  = actual_ir_node->next;
+      actual_ast_node = actual_ast_node->next;
+   }
+
+   /* The first parameter of atomic functions must be a buffer variable */
+   const char *func_name = sig->function_name();
+   bool is_atomic = is_atomic_function(func_name);
+   if (is_atomic) {
+      const ir_rvalue *const actual = (ir_rvalue *) actual_ir_parameters.head;
+
+      const ast_expression *const actual_ast =
+         exec_node_data(ast_expression, actual_ast_parameters.head, link);
+      YYLTYPE loc = actual_ast->get_location();
+
+      if (!verify_first_atomic_parameter(&loc, state,
+                                         actual->variable_referenced())) {
+         return false;
+      }
+   }
+
+   return true;
+}
+
+static void
+fix_parameter(void *mem_ctx, ir_rvalue *actual, const glsl_type *formal_type,
+              exec_list *before_instructions, exec_list *after_instructions,
+              bool parameter_is_inout)
+{
+   ir_expression *const expr = actual->as_expression();
+
+   /* If the types match exactly and the parameter is not a vector-extract,
+    * nothing needs to be done to fix the parameter.
+    */
+   if (formal_type == actual->type
+       && (expr == NULL || expr->operation != ir_binop_vector_extract))
+      return;
+
+   /* To convert an out parameter, we need to create a temporary variable to
+    * hold the value before conversion, and then perform the conversion after
+    * the function call returns.
+    *
+    * This has the effect of transforming code like this:
+    *
+    *   void f(out int x);
+    *   float value;
+    *   f(value);
+    *
+    * Into IR that's equivalent to this:
+    *
+    *   void f(out int x);
+    *   float value;
+    *   int out_parameter_conversion;
+    *   f(out_parameter_conversion);
+    *   value = float(out_parameter_conversion);
+    *
+    * If the parameter is an ir_expression of ir_binop_vector_extract,
+    * additional conversion is needed in the post-call re-write.
+    */
+   ir_variable *tmp =
+      new(mem_ctx) ir_variable(formal_type, "inout_tmp", ir_var_temporary);
+
+   before_instructions->push_tail(tmp);
+
+   /* If the parameter is an inout parameter, copy the value of the actual
+    * parameter to the new temporary.  Note that no type conversion is allowed
+    * here because inout parameters must match types exactly.
+    */
+   if (parameter_is_inout) {
+      /* Inout parameters should never require conversion, since that would
+       * require an implicit conversion to exist both to and from the formal
+       * parameter type, and there are no bidirectional implicit conversions.
+       */
+      assert (actual->type == formal_type);
+
+      ir_dereference_variable *const deref_tmp_1 =
+         new(mem_ctx) ir_dereference_variable(tmp);
+      ir_assignment *const assignment =
+         new(mem_ctx) ir_assignment(deref_tmp_1, actual);
+      before_instructions->push_tail(assignment);
+   }
+
+   /* Replace the parameter in the call with a dereference of the new
+    * temporary.
+    */
+   ir_dereference_variable *const deref_tmp_2 =
+      new(mem_ctx) ir_dereference_variable(tmp);
+   actual->replace_with(deref_tmp_2);
+
+
+   /* Copy the temporary variable to the actual parameter with optional
+    * type conversion applied.
+    */
+   ir_rvalue *rhs = new(mem_ctx) ir_dereference_variable(tmp);
+   if (actual->type != formal_type)
+      rhs = convert_component(rhs, actual->type);
+
+   ir_rvalue *lhs = actual;
+   if (expr != NULL && expr->operation == ir_binop_vector_extract) {
+      lhs = new(mem_ctx) ir_dereference_array(expr->operands[0]->clone(mem_ctx, NULL),
+                                              expr->operands[1]->clone(mem_ctx, NULL));
+   }
+
+   ir_assignment *const assignment_2 = new(mem_ctx) ir_assignment(lhs, rhs);
+   after_instructions->push_tail(assignment_2);
+}
+
+/**
+ * Generate a function call.
+ *
+ * For non-void functions, this returns a dereference of the temporary variable
+ * which stores the return value for the call.  For void functions, this returns
+ * NULL.
+ */
+static ir_rvalue *
+generate_call(exec_list *instructions, ir_function_signature *sig,
+             exec_list *actual_parameters,
+              ir_variable *sub_var,
+             ir_rvalue *array_idx,
+             struct _mesa_glsl_parse_state *state)
+{
+   void *ctx = state;
+   exec_list post_call_conversions;
+
+   /* Perform implicit conversion of arguments.  For out parameters, we need
+    * to place them in a temporary variable and do the conversion after the
+    * call takes place.  Since we haven't emitted the call yet, we'll place
+    * the post-call conversions in a temporary exec_list, and emit them later.
+    */
+   foreach_two_lists(formal_node, &sig->parameters,
+                     actual_node, actual_parameters) {
+      ir_rvalue *actual = (ir_rvalue *) actual_node;
+      ir_variable *formal = (ir_variable *) formal_node;
+
+      if (formal->type->is_numeric() || formal->type->is_boolean()) {
+        switch (formal->data.mode) {
+        case ir_var_const_in:
+        case ir_var_function_in: {
+           ir_rvalue *converted
+              = convert_component(actual, formal->type);
+           actual->replace_with(converted);
+           break;
+        }
+        case ir_var_function_out:
+        case ir_var_function_inout:
+            fix_parameter(ctx, actual, formal->type,