summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Define YY_NO_UNISTD_H on MSVC.José Fonseca2011-03-042-0/+8
|
* glcpp: Remove trailing contexts from #if rules.Kenneth Graunke2011-03-031-6/+6
| | | | These are now unnecessary.
* glcpp: Rework lexer to use a SKIP state rather than REJECT.Kenneth Graunke2011-03-031-21/+16
| | | | | | | | | | | | | | | | | | | Previously, the rule deleted by this commit was matched every single time (being the longest match). If not skipping, it used REJECT to continue on to the actual correct rule. The flex manual advises against using REJECT where possible, as it is one of the most expensive lexer features. So using it on every match seems undesirable. Perhaps more importantly, it made it necessary for the #if directive rules to contain a look-ahead pattern to make them as long as the (now deleted) "skip the whole line" rule. This patch introduces an exclusive start state, SKIP, to avoid REJECTs. Each time the lexer is called, the code at the top of the rules section will run, implicitly switching the state to the correct one. Fixes piglit tests 16384-consecutive-chars.frag and 16385-consecutive-chars.frag.
* glcpp/tests: Update 063-comments.c.expected to match output.Kenneth Graunke2011-03-031-0/+7
| | | | | | | The expected result has been out of sync with what glcpp produces for some time; glcpp's actual result seems to be correct and is very close to GCC's cpp. Updating this will make it easier to catch regressions in upcoming commits.
* scons: More tweaks to fix MinGW build.José Fonseca2011-03-031-5/+16
|
* scons: Ensure generated headers are in the include path.José Fonseca2011-03-031-0/+3
|
* glsl: Remove unused glcpp/Makefile.am.Kenneth Graunke2011-03-021-44/+0
| | | | This is a remnant of when glsl2 lived in its own repository.
* glsl: Remove 'tests' subfolder.Kenneth Graunke2011-03-0270-631/+0
| | | | These have long since moved to piglit and aren't useful to have here.
* scons: Use Flex and Bison to generate lexer/parser files.Kenneth Graunke2011-03-011-4/+15
| | | | | This gets it building again here; I'll leave it up to the SCons maintainers to make further improvements.
* glsl: Rename .lpp to .ll and .ypp to .yy.Kenneth Graunke2011-03-013-2/+2
| | | | | SCons has built-in support for .ll and .yy, but not .lpp and .ypp. Since there's no real benefit to using the old names, change them.
* Add generated parser / lexer files to gitignore listsIan Romanick2011-03-012-0/+6
|
* glcpp: Remove files generated by flex and bison from GITIan Romanick2011-03-013-7003/+0
|
* glsl: Remove files generated by flex and bison from GITIan Romanick2011-03-013-9482/+0
|
* glsl: Enable GL_OES_texture_3D extension for ES2.Kenneth Graunke2011-02-287-2/+39
|
* glsl: Use reralloc instead of plain realloc.Kenneth Graunke2011-02-281-5/+3
| | | | | | Plugs a memory leak when compiling shaders with user defined structures. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl/builtins: Fix return type for textureSize sampler2DArray variants.Kenneth Graunke2011-02-272-4/+4
| | | | A copy and paste error.
* glsl/Makefile: Remove builtin_function.cpp if generation fails.Arkadiusz Miskiewicz2011-02-261-1/+1
| | | | | | Fixes bug #34346. Signed-off-by: Kenneth Graunke <[email protected]>
* Use C-style system headers in C++ code to avoid issues with std:: namespaceIan Romanick2011-02-2124-57/+8
|
* glsl: Remove $(PWD) from Makefile in favor of .Kenneth Graunke2011-02-191-1/+1
| | | | Hopefully should fix bug #34468.
* linker: Fix off-by-one error implicit array sizingIan Romanick2011-02-151-1/+1
| | | | | | | | | Arrays are zero based. If the highest element accessed is 6, the array needs to have 7 elements. Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl: Reinstate constant-folding for division by zeroChad Versace2011-02-151-21/+21
| | | | | | | | | | | | | | | Fixes regression: https://bugs.freedesktop.org/show_bug.cgi?id=34160 Commit e7c1f058d18f62aa4871aec623f994d7b68cb8c1 disabled constant-folding when division-by-zero occured. This was a mistake, because the spec does allow division by zero. (From section 5.9 of the GLSL 1.20 spec: Dividing by zero does not cause an exception but does result in an unspecified value.) For floating-point division, the original pre-e7c1f05 behavior is reinstated. For integer division, constant-fold 1/0 to 0.
* Revert "glsl: Fix constant-folding for reciprocal expressions"Chad Versace2011-02-151-10/+6
| | | | | | | | | | | | This reverts commit b3cf92aa916ee0537ee37723c23a9897ac9cd3e0. The reverted commit prevented constant-folding of reciprocal expressions when the reciprocated expression was 0. However, since the spec allows division by zero, constant-folding *is* permissible in this case. From Section 5.9 of the GLSL 1.20 spec: Dividing by zero does not cause an exception but does result in an unspecified value.
* mesa: Optionally build a dricore support library (v3)Christopher James Halse Rogers2011-02-111-3/+31
| | | | | | | | | | | | | | | | | This an adds --enable-shared-dricore option to configure. When enabled, DRI modules will link against a shared copy of the common mesa routines rather than statically linking these. This saves about 30MB on disc with a full complement of classic DRI drivers. v2: Only enable with a gcc-compatible compiler that handles rpath Handle DRI_CFLAGS without filter-out magic Build shared libraries with the full mklib voodoo Fix typos v3: Resolve conflicts with talloc removal patches Signed-off-by: Christopher James Halse Rogers <[email protected]>
* glcpp: regerated filesIan Romanick2011-02-112-181/+193
| | | | | These should have been committed right after fd1252ab, but they were missed. Soon, we'll never have to do this again...
* glsl: Regenerate files modified by previous commitsIan Romanick2011-02-113-1798/+1899
|
* glsl: Finish out the reduce/reduce error fixesIan Romanick2011-02-113-59/+109
| | | | | | | | | | | | | Track variables, functions, and types during parsing. Use this information in the lexer to return the currect "type" for identifiers. Change the handling of structure constructors. They will now show up in the AST as constructors (instead of plain function calls). Fixes piglit tests constructor-18.vert, constructor-19.vert, and constructor-20.vert. Also fixes bugzilla #29926. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl: Eliminate reduce/reduce conflicts in glsl grammarKeith Packard2011-02-111-21/+71
| | | | | | | | | This requires lexical disambiguation between variable and type identifiers (as most C compilers do). Signed-off-by: Keith Packard <[email protected]> NOTE: This is a candidate for the 7.9 and 7.10 branches.
* scons: builtin_glsl_function on windows needs bundled getopt.José Fonseca2011-02-111-1/+7
|
* scons: Try to support building 64bit binaries on 32bit windows.José Fonseca2011-02-111-4/+1
|
* glsl: Fix parallel build.Tobias Jakobi2011-02-111-1/+2
| | | | | | Broken since e0c1fc32832b66b52e6352ba563288ee48a1face. Signed-off-by: Kenneth Graunke <[email protected]>
* glsl/Makefile: glcpp doesn't need libglsl.a.Kenneth Graunke2011-02-101-1/+2
| | | | | Also, add a 'glcpp' target so you can type 'make glcpp' instead of 'make glcpp/glcpp'.
* glsl: Disable the new copy propagation pass until it gets fixed.Eric Anholt2011-02-081-1/+1
| | | | It apparently regressed a bunch of ES2 cases.
* glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30Chad Versace2011-02-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | From section 5.9 of the GLSL 1.20 spec: The operator modulus (%) is reserved for future use. From section 5.8 of the GLSL 1.20 spec: The assignments modulus into (%=), left shift by (<<=), right shift by (>>=), inclusive or into ( |=), and exclusive or into ( ^=). These operators are reserved for future use. The GLSL ES 1.00 spec and GLSL 1.10 spec have similiar language. Fixes bug: https://bugs.freedesktop.org//show_bug.cgi?id=33916 Fixes Piglit tests: spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag spec/glsl-1.10/compiler/arithmetic-operators/modulus-00.frag spec/glsl-1.10/compiler/assignment-operators/modulus-assign-00.frag spec/glsl-1.20/compiler/arithmetic-operators/modulus-00.frag spec/glsl-1.20/compiler/assignment-operators/modulus-assign-00.frag
* linker: Generate link errors when ES shaders are missing stagesIan Romanick2011-02-041-0/+14
| | | | | | ES requires that a vertex shader and a fragment shader be present. Fixes bugzilla #32214.
* glsl: Add opt_copy_propagation_elements.cpp to SConscript.Vinson Lee2011-02-041-0/+1
| | | | Fixes SCons build.
* glsl: Remove extra checks for constant true assignment conditions.Eric Anholt2011-02-045-28/+9
| | | | These are already stripped by opt_constant_folding.cpp.
* glsl: Fix a comment typo in copy propagation.Eric Anholt2011-02-041-1/+1
|
* glsl: Add a new opt_copy_propagation variant that does it channel-wise.Eric Anholt2011-02-044-0/+464
| | | | | | | | | | This patch cleans up many of the extra copies in GLSL IR introduced by i965's scalarizing passes. It doesn't result in a statistically significant performance difference on nexuiz high settings (n=3) or my demo (n=10), due to brw_fs.cpp's register coalescing covering most of those extra moves anyway. However, it does make the debug of wine's GLSL shaders much more tractable, and reduces instruction count of glsl-fs-convolution-2 from 376 to 288.
* ralloc: Add missing va_end following va_copy.Vinson Lee2011-02-031-0/+2
|
* glsl: Add using statements for standard library functions.Vinson Lee2011-02-0314-0/+33
| | | | | | | | | | | | | Standard library functions in C++ are in the std namespace. When using C++-style header files for the standard library, some compilers, such as Sun Studio, provide symbols only for the std namespace and not for the global namespace. This patch adds using statements for standard library functions. Another option could have been to prepend standard library function calls with 'std::'. This patch fixes several compilation errors with Sun Studio.
* glcpp: Raise error when modulus is zeroChad Versace2011-02-021-1/+6
| | | | | | | | | | For example, this now raises an error: #define XXX 1 / 0 Fixes bug: https://bugs.freedesktop.org//show_bug.cgi?id=33507 Fixes Piglit test: spec/glsl-1.10/preprocessor/modulus-by-zero.vert NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl: Avoid division-by-zero during constant-foldingChad Versace2011-02-021-1/+19
| | | | | | | | | | | | | | | | | | | | | Avoid division-by-zero when constant-folding the following expression types: ir_unop_rsq ir_binop_div ir_binop_mod Fixes bugs: https://bugs.freedesktop.org//show_bug.cgi?id=33306 https://bugs.freedesktop.org//show_bug.cgi?id=33508 Fixes Piglit tests: glslparsertest/glsl2/div-by-zero-01.frag glslparsertest/glsl2/div-by-zero-02.frag glslparsertest/glsl2/div-by-zero-03.frag glslparsertest/glsl2/modulus-zero-01.frag glslparsertest/glsl2/modulus-zero-02.frag NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl: Fix constant-folding for reciprocal expressionsChad Versace2011-02-021-6/+10
| | | | | | | | | | | | | | | Do not constant-fold a reciprocal if any component of the reciprocated expression is 0. For example, do not constant-fold `1 / vec4(0, 1, 2, 3)`. Incorrect, previous behavior ---------------------------- Reciprocals were constant-folded even when some component of the reciprocated expression was 0. The incorrectly applied arithmetic was: 1 / 0 := 0 For example, 1 / vec4(0, 1, 2, 3) = vec4(0, 1, 1/2, 1/3) NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.Kenneth Graunke2011-02-011-0/+2
| | | | | | This has probably existed since e5e34ab18eeaffa465 or so. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl: Fix invalid use of ralloc_asprintf in prototype_string.Kenneth Graunke2011-02-011-1/+1
| | | | | | | | This was my mistake when converting from talloc to ralloc. I was confused because the other calls in the function are to asprintf_append and the original code used str as the context rather than NULL. Fixes bug #33823.
* glsl: Fix printf_length() on MSVC.José Fonseca2011-02-011-0/+8
|
* glsl: Fix memory error when creating the supported version string.Kenneth Graunke2011-02-011-1/+1
| | | | | | | | Passing ralloc_vasprintf_append a 0-byte allocation doesn't work. If passed a non-NULL argument, ralloc calls strlen to find the end of the string. Since there's no terminating '\0', it runs off the end. Fixes a crash introduced in 14880a510a1a288df0778395097d5a52806abfb0.
* texture_builtins.py: Fix a warning about mixed tabs/spaces.Kenneth Graunke2011-01-311-1/+1
|
* glsl: Refresh autogenerated lexer and parser files.Ian Romanick2011-01-311-256/+271
| | | | For the previous commit.
* glsl: Reject shader versions not supported by the implementationIan Romanick2011-01-313-9/+82
| | | | | | | | Previously we'd happily compile GLSL 1.30 shaders on any driver. We'd also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context. This has been a long standing FINISHME in the compiler. NOTE: This is a candidate for the 7.9 and 7.10 branches