summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Include main/core.h.Chia-I Wu2010-08-2418-30/+16
| | | | Make glsl include only main/core.h from core mesa.
* glsl: Rely on talloc_autofree_context() instead of trying to free on our own.Eric Anholt2010-08-231-6/+1
| | | | | | | | | | | Because the static types talloc their names at dlopen time, talloc_freeing the types at DRI driver screen teardown means that if the screen gets brought back up again, the names will point at freed memory. talloc_autofree_context() exists to do just what we want here: Free memory referenced across the program's lifetime so that we avoid noise in memory leak checkers. Fixes: bug #29722 (assertion failure in unigine).
* glsl: When unable to assign the initializer for a const variable, set it to 0.Eric Anholt2010-08-231-13/+21
| | | | | | | This prevents assertion failures or cascading errors after we've logged the fact that we were unable to handle the initializer. Fixes unsized-array-non-const-index-2.vert
* glsl: Cleanly fail when a function has an unknown return type.Eric Anholt2010-08-231-1/+7
| | | | Bug #29608.
* glsl: Rebuild builtins for any() change.Eric Anholt2010-08-231-3/+3
|
* mesa: Add new ir_unop_any() expression operation.Eric Anholt2010-08-236-3/+21
| | | | | | | The previous any() implementation would generate arg0.x || arg0.y || arg0.z. Having an expression operation for this makes it easy for the backend to generate something easier (DPn + SNE for 915 FS, .any predication on 965 VS)
* glsl: Regenerate builtins with the new sorting.Eric Anholt2010-08-231-5089/+5089
|
* glsl: Count function call outvals as writing to variables for linker checks.Eric Anholt2010-08-231-0/+21
| | | | Fixes: glsl-vs-position-outval. Bug #28138 (regnum online)
* glsl2: Include imports.h to get snprintf wrapper for MSVCIan Romanick2010-08-232-1/+2
| | | | Signed-off-by: José Fonseca <[email protected]>
* generate_builtins.py: Generate output in sorted order.Kenneth Graunke2010-08-231-5/+6
|
* glcpp: Make standalone preprocessor work with a tty as stdinCarl Worth2010-08-231-33/+49
| | | | | | | | | | | | Previously glcpp would silently abort if it couldn't fstat the file being read, (so it would work with stdin redirected from a file, but would not work with stdin as a tty). The stat was so that glcpp could allocate a buffer for the file content in a single call. We now use talloc_realloc instead, (even if the fstat is possible). This is theoretically less efficient, but quite irrelevant, (particularly because the standalone preprocessor is used only for testing).
* glcpp: Fix test suite to avoid flagging failed tests as valgrind errors.Carl Worth2010-08-231-4/+5
| | | | | | | | | | We recently added several tests that intentionally trigger preprocessor errors. During valgrind-based testing, our test script was noticing the non-zero return value from the preprocessor and incorrectly flagging the valgrind-based test as failing. To fix this, we make valgrind return an error code that is otherwise unused by the preprocessor.
* glcpp: Fix segfault in standalone preprocessor for "file not found", etc.Carl Worth2010-08-231-4/+17
| | | | | | | | This error message was missing so that the program would simply segfault if the provided filename could not be opened for some reason. While we're at it, we add explicit support for a filename of "-" to indicate input from stdin.
* glcpp: Update generated glcpp-lex.c for the last two changes.Carl Worth2010-08-231-191/+186
| | | | | This fixes both "#line 0" and "#line XXX YYY" as described in the two most recent commits.
* glcpp: Fix handling of "#line 0"Carl Worth2010-08-231-2/+3
| | | | | | | | | | | | | | | | The existing DECIMAL_INTEGER pattern is the correct thing to use when looking for a C decimal integer, (that is, a digit-sequence not starting with 0 which would instead be an octal integer). But for #line, we really want to accept any digit sequence, (including "0"), and always interpret it as a decimal constant. So we add a new DIGITS pattern for this case. This should fix the compilation failure noted in bug #28138 https://bugs.freedesktop.org/show_bug.cgi?id=28138 (Though the generated file will not be updated until the next commit.)
* glcpp: Fix source numbers set with "#line LINE_NUMBER SOURCE_NUMBER"Carl Worth2010-08-231-2/+7
| | | | | | | Previously, the YY_USER_ACTION was overwriting the yylloc->source value in every action, (after that value had been carefully set by the handling of the #line directive). Instead, we want to initialize it once in YY_USER_INIT and then not touch it at all in YY_USER_ACTION.
* glcpp: Add new test for #line directive.Carl Worth2010-08-232-0/+21
| | | | | | | | | | | | This test exposes two current bugs: 1. The source number is not being correctly emitted in error messages (instead, it's always 0). 2. A directive of "#line 0" is resulting in the following parse error: preprocessor error: Invalid tokens after #
* glcpp: Update README file (new specifications and fewer limitations).Carl Worth2010-08-231-12/+14
| | | | | | | The README file had grown a little bit stale. We've been using newer versions of both the GLSL and C99 specifications, so list those. Also, several of the documented known limitations have since been fixed, so remove those.
* glcpp: Add test for the #error directive.Carl Worth2010-08-232-0/+4
| | | | | | | This directive is already implemented nicely, but wasn't previously tested. It will be convenient to use this directive in further tests that rely on error messages, (such as ensuring that #line correctly sets the line number in the error message).
* glsl: Trim the size of uniform arrays to the maximum element used.Eric Anholt2010-08-232-0/+57
| | | | Fixes glsl-getactiveuniform-array-size.
* glsl2: Add missing sig_iter.next() to the no-constant-folding-to-outvals fix.Eric Anholt2010-08-232-0/+2
|
* glsl: Don't constant-fold in a constant in place of a function outval.Eric Anholt2010-08-221-0/+22
|
* glsl: Convert constant folding to the rvalue visitor.Eric Anholt2010-08-221-181/+19
| | | | | | | | | | This should be mostly a noop, except that a plain dereference of a variable that is not part of a constant expression could now get "constant folded". I expect that for all current backends this will be either a noop, or possibly a win when it provokes more ir_algebraic. It'll also ensure that when new features are added, tree walking will work normally. Before this, constants weren't getting folded inside of loops.
* glsl: Don't tree-graft in an expression in place of a function outval.Eric Anholt2010-08-221-0/+5
| | | | Fixes: glsl-constant-folding-call-1 (bug #29737)
* mesa: AC_SUBST the talloc libs/cflags so the ./configure results are saved.Eric Anholt2010-08-221-1/+2
| | | | | | | | | | I had used pkg-config from the Makefile because I didn't want to screw around with the non-autoconf build, but that doesn't work because the PKG_CONFIG_PATH or TALLOC_LIBS/TALLOC_CFLAGS that people set at configure time needs to be respected and may not be present at build time. Bug #29585
* glsl: Silence uninitialized variable warning.Vinson Lee2010-08-211-0/+3
| | | | | | | i686-apple-darwin10-gcc-4.2.1 generated the following warning. warning: 'score' may be used uninitialized in this function GCC 4.4.3 on Linux didn't generate the above warning.
* glsl: Silence unused variable warning.Vinson Lee2010-08-211-0/+1
| | | | The variable is actually used but only in the body of an assert.
* glsl: Handle array declarations in function parameters.Kenneth Graunke2010-08-211-4/+13
| | | | | | | | | The 'vec4[12] foo' style already worked, but the 'vec4 foo[12]' style did not. Also, 'vec4[] foo' was wrongly accepted. Fixes piglit test cases array-19.vert and array-21.vert. May fix fd.o bug #29684 (or at least part of it).
* generate_builtins.py: Remove unused import sys.Vinson Lee2010-08-211-1/+1
|
* Delete more vestiges of the old shader compiler.Kenneth Graunke2010-08-207-1207/+0
|
* Remove remnants of the old glsl compiler.Eric Anholt2010-08-2028-8082/+0
|
* ast_to_hir: Reject function names that start with "gl_".Kenneth Graunke2010-08-201-0/+12
| | | | Fixes piglit test redeclaration-03.vert.
* ast_to_hir: Fix crash when a function shadows a variable.Kenneth Graunke2010-08-201-2/+3
| | | | | | | | The code would attempt to add a new signature to the ir_function, which didn't exist. Simply bailing out/returning early seems reasonable. Fixes piglit test redeclaration-02.vert, and fixes a crash in redeclaration-03.vert (the test still fails).
* glsl: Replace sscanf in s_expression reader with strspn and strcspn.Kenneth Graunke2010-08-182-21/+30
| | | | This seems to give roughly a 20% speedup.
* glsl: Also strdup the names of uniform list entries for >vec4 types.Eric Anholt2010-08-181-1/+1
| | | | Fixes double-free since the fix to free all of the uniform list.
* glcpp: Refresh autogenerated lexer.Kenneth Graunke2010-08-181-263/+326
|
* glcpp: Add basic #line support (adapted from the main compiler).Kenneth Graunke2010-08-181-0/+31
|
* glsl2: Free the shader compiler at dri screen destruction.Eric Anholt2010-08-182-0/+33
| | | | | | Hooray, we can valgrind again without adding suppressions. This also adds an interface for use by an implementation of glReleaseShaderCompiler().
* glsl: Fix leak-causing typo in destructor that made it another constructor.Eric Anholt2010-08-181-1/+1
|
* glsl: Fix uninitialized member in ir_hierarchical_vistor constructor.Vinson Lee2010-08-181-0/+1
| | | | Class member base_ir was not initialized by the default constructor.
* glsl: Garbage collect old prototype for ir_to_mesa.Eric Anholt2010-08-181-2/+0
|
* mesa: Free old linked shaders when relinking new shaders.Eric Anholt2010-08-183-7/+16
|
* glsl2: Fix copy'n'paste hilarity leading to leaking in the refcount visitor.Eric Anholt2010-08-182-2/+1
|
* glsl: Fix scoping bug in if statements.Kenneth Graunke2010-08-181-2/+8
| | | | | Fixes glslparsertest/glsl2/scoping-01.frag (successfully compiled but should've failed) and scoping-02.frag (assertion triggered).
* glsl: Refresh autogenerated file builtin_function.cpp.Kenneth Graunke2010-08-181-14184/+6719
|
* generate_builtins.py: Clean up generated output a bit.Kenneth Graunke2010-08-181-0/+12
| | | | | | | | This should make it easier to diff the output, clean up some of the insane whitespace, and make the strings a bit smaller. We'll probably need to split up the prototype strings eventually, but for now, this gets it under the 65K mark.
* glsl/builtins: Add forgotten hyperbolic trig builtins in 1.30 profiles.Kenneth Graunke2010-08-182-0/+64
|
* ir_constant_expression: Implement equal/notEqual for booleans.Kenneth Graunke2010-08-181-0/+6
| | | | | | Calls to equal(bvec, bvec) or notEqual(bvec, bvec) previously caused an assertion. Fixes piglit tests glsl-const-builtin-equal-bool and glsl-const-builtin-notEqual-bool.
* glsl2: Regenerate builtin_function.cpp.Kenneth Graunke2010-08-171-4334/+4334
|
* glsl2: Fix cut and paste error in EXT_texture_array builtins.Kenneth Graunke2010-08-172-4/+4
| | | | Fixes fd.o bug #29629.