summaryrefslogtreecommitdiff
path: root/src/glsl
AgeCommit message (Collapse)Author
2010-08-29glsl: Initialize variable in ir_swizzle::constant_expression_value.Vinson Lee
Complete initialize data passed to ir_constant constructor. Fixes piglit glsl-mat-from-int-ctor-02 valgrind unintialized variable error with softpipe and llvmpipe.
2010-08-29glsl: Initialize data in read_constant.Vinson Lee
Completely initialize data that is passed into a ir_constant constructor. Fixes piglit glsl-fs-mix valgrind uninitialized variable error on softpipe and llvmpipe.
2010-08-28glsl: Initialize the rest of values of ir_constant::value.Vinson Lee
Fixes valgrind uninitialized value errors in the piglit shader tests for softpipe and llvmpipe.
2010-08-27glsl2: Decompose matrix comparison into vector operationsIan Romanick
2010-08-27glsl: Rename a couple of common variable names in mat_op_to_vec.Eric Anholt
It was easy while typing implementations to accidentally overwrite the original expression or assignment variables.
2010-08-27glsl: Make mat_op_to_vec allocate out of the IR's parent.Eric Anholt
This will reduce memory consumption of compiled shaders by not dragging optimized-out children around.
2010-08-27glsl: Regenerate for double destroy fix.Eric Anholt
2010-08-27glsl: Protect against double compiler-destroy.Eric Anholt
DRI was doing teardown when we close the last screen, then an atexit() was added to call it as well.
2010-08-27glsl2: restructure header file for C++ and C inclusionBrian Paul
As it was, the header could not be cleanly #included by a C source.
2010-08-27glsl2: remove 'extern' keyword in .c fileBrian Paul
2010-08-26glsl: Add a quick hack to constant folding to reduce duplicated work.Eric Anholt
Reduces runtime of glsl-max-varyings 92% on my system.
2010-08-26scons: Add glsl_symbol_table.cppJosé Fonseca
2010-08-26glsl2: Remove a couple FINISHME comments that have already been resolvedIan Romanick
2010-08-26glsl: Move built-ins to live beyond the global scope.Kenneth Graunke
Per the GLSL 1.20 specification (presumably a clarification of 1.10). Also, when creating user functions, make a new ir_function that shadows the built-in ir_function, rather than adding new signatures. User functions are supposed to hide built-ins, not overload them. Fixes piglit tests redeclaration-{04, 12, 14}.vert.
2010-08-26glsl: Move is_built_in flag from ir_function_signature to ir_function.Kenneth Graunke
Also rename it to "is_builtin" for consistency. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-26glsl: Refactor variable declaration handling.Kenneth Graunke
Moving the check for an earlier variable declaration helps cleanly separate out the re-declaration vs. new declaration code a bit. With that in place, conflicts between variable names and structure types or function names aren't caught by the earlier "redeclaration" error message, so check the return type on glsl_symbol_table::add_variable and issue an error there. If one occurs, don't emit the initializer. Fixes redeclaration-01.vert and redeclaration-09.vert. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-26glsl: Don't add overloads to existing structure constructors.Kenneth Graunke
Instead, make a new ir_function and try to add it to the symbol table. Fixes piglit test redeclaration-08.vert.
2010-08-26glsl: Remove name_declared_this_scope check when adding functions.Kenneth Graunke
Instead, rely on the symbol table's rules. Fixes redeclaration-02.vert.
2010-08-26glsl: Use a single shared namespace in the symbol table.Kenneth Graunke
As of 1.20, variable names, function names, and structure type names all share a single namespace, and should conflict with one another in the same scope, or hide each other in nested scopes. However, in 1.10, variables and functions can share the same name in the same scope. Structure types, however, conflict with/hide both. Fixes piglit tests redeclaration-06.vert, redeclaration-11.vert, redeclaration-19.vert, and struct-05.vert.
2010-08-26glsl2: Move ir_expression_flattening to using the rvalue visitor class.Eric Anholt
The previous implementation was missing handling of some rvalues, such as "if" conditions, leading to glsl-mat-int-from-ctor-* not getting caught.
2010-08-25glsl: Don't consider things with a type containing a sampler as an lvalue.Eric Anholt
We had ad-hoc handled some common cases by flagging sampler-typed variables as read_only, and rejected initializers of samplers. However, people could sneak them in in all sorts of surprising ways, like using whole-array or structure assignment. Fixes: glslparsertest/glsl2/sampler-01.frag glslparsertest/glsl2/sampler-03.frag glslparsertest/glsl2/sampler-04.frag glslparsertest/glsl2/sampler-06.frag Bug #27403.
2010-08-25glsl: fix crash with variable indexing into array in a structAras Pranckevicius
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-25ir_to_mesa: Convert this code to using linker.cpp's uniform locations.Eric Anholt
Fixes: glsl-fs-uniform-array-4.
2010-08-25glsl: Make uniform linking generate separate uniforms for struct members.Eric Anholt
This is a step towards making the linker code usable as our uniform setup, instead of having it wedged into ir_to_mesa.cpp.
2010-08-25glsl/mesa: fixes for MSVCAras Pranckevicius
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-24glsl: Don't dead-code eliminate a uniform initializer.Eric Anholt
Partial fix for glsl-uniform-initializer-5.
2010-08-24glsl2: rename local variable_entry classBrian Paul
With MSVC it seems that this class and its constructor is colliding with the one in ir_variable_refcount.cpp. Rename the class here to avoid the collision. This is a bit of a hack. Can the two variable_entry classes be merged and shared?
2010-08-24glsl2: move constructor into .cpp file to work around compiler bugBrian Paul
Fixes fd.o bug 29770 The refcount==0 assertion only failed on some systems. One example being 32-bit Linux with gcc 4.4.4.
2010-08-24glsl: Add assert to check variable_entry referenced_count after construction.Vinson Lee
A variable_entry after construction should have its referenced_count member set to 0. However, occassionally this isn't the case and entry->referenced_count has been observed to be a garbage value. This leads to crashes of several tests in the Piglit test suite. This patch adds an assert to check that a variable_entry instance has its referenced_count member initialized to 0 after construction.
2010-08-24glsl: make 'make clean' work properly.Dave Airlie
this has make clean remove all the objects.
2010-08-23glsl: Silence unused variable warning.Vinson Lee
The variable is used but only in the body of an assert.
2010-08-24glsl: Include main/core.h.Chia-I Wu
Make glsl include only main/core.h from core mesa.
2010-08-23glsl: Rely on talloc_autofree_context() instead of trying to free on our own.Eric Anholt
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).
2010-08-23glsl: When unable to assign the initializer for a const variable, set it to 0.Eric Anholt
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
2010-08-23glsl: Cleanly fail when a function has an unknown return type.Eric Anholt
Bug #29608.
2010-08-23glsl: Rebuild builtins for any() change.Eric Anholt
2010-08-23mesa: Add new ir_unop_any() expression operation.Eric Anholt
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)
2010-08-23glsl: Regenerate builtins with the new sorting.Eric Anholt
2010-08-23glsl: Count function call outvals as writing to variables for linker checks.Eric Anholt
Fixes: glsl-vs-position-outval. Bug #28138 (regnum online)
2010-08-23glsl2: Include imports.h to get snprintf wrapper for MSVCIan Romanick
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-23generate_builtins.py: Generate output in sorted order.Kenneth Graunke
2010-08-23glcpp: Make standalone preprocessor work with a tty as stdinCarl Worth
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).
2010-08-23glcpp: Fix test suite to avoid flagging failed tests as valgrind errors.Carl Worth
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.
2010-08-23glcpp: Fix segfault in standalone preprocessor for "file not found", etc.Carl Worth
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.
2010-08-23glcpp: Update generated glcpp-lex.c for the last two changes.Carl Worth
This fixes both "#line 0" and "#line XXX YYY" as described in the two most recent commits.
2010-08-23glcpp: Fix handling of "#line 0"Carl Worth
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.)
2010-08-23glcpp: Fix source numbers set with "#line LINE_NUMBER SOURCE_NUMBER"Carl Worth
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.
2010-08-23glcpp: Add new test for #line directive.Carl Worth
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 #
2010-08-23glcpp: Update README file (new specifications and fewer limitations).Carl Worth
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.
2010-08-23glcpp: Add test for the #error directive.Carl Worth
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).