summaryrefslogtreecommitdiff
path: root/src/glsl/Makefile
AgeCommit message (Collapse)Author
2011-03-01glsl: Rename .lpp to .ll and .ypp to .yy.Kenneth Graunke
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.
2011-02-26glsl/Makefile: Remove builtin_function.cpp if generation fails.Arkadiusz Miskiewicz
Fixes bug #34346. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-02-19glsl: Remove $(PWD) from Makefile in favor of .Kenneth Graunke
Hopefully should fix bug #34468.
2011-02-11mesa: Optionally build a dricore support library (v3)Christopher James Halse Rogers
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 <christopher.halse.rogers@canonical.com>
2011-02-11glsl: Fix parallel build.Tobias Jakobi
Broken since e0c1fc32832b66b52e6352ba563288ee48a1face. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-02-10glsl/Makefile: glcpp doesn't need libglsl.a.Kenneth Graunke
Also, add a 'glcpp' target so you can type 'make glcpp' instead of 'make glcpp/glcpp'.
2011-02-04glsl: Add a new opt_copy_propagation variant that does it channel-wise.Eric Anholt
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.
2011-01-31glsl: Fix dependencies / linkage for glsl_compilerIan Romanick
2011-01-31Remove talloc from the make and automake build systems.Kenneth Graunke
2011-01-31ralloc: Add a fake implementation of ralloc based on talloc.Kenneth Graunke
2011-01-12glsl/Makefile: Fix build with --as-needed.Kenneth Graunke
2011-01-10glsl: Autogenerate builtin_functions.cpp as part of the build process.Kenneth Graunke
Python is already necessary for other parts of Mesa, so there's no reason we can't just generate it. This patch updates both make and SCons to do so.
2010-12-14glsl: new glsl_strtod() wrapper to fix decimal point interpretationBrian Paul
We always want to use '.' as the decimal point. See http://bugs.freedesktop.org/show_bug.cgi?id=24531 NOTE: this is a candidate for the 7.10 branch.
2010-12-01glsl: Add a lowering pass to move discards out of if-statements.Kenneth Graunke
This should allow lower_if_to_cond_assign to work in the presence of discards, fixing bug #31690 and likely #31983. NOTE: This is a candidate for the 7.9 branch.
2010-12-01glsl: Add an optimization pass to simplify discards.Kenneth Graunke
NOTE: This is a candidate for the 7.9 branch.
2010-11-19glsl: Combine many instruction lowering passes into one.Kenneth Graunke
This should save on the overhead of tree-walking and provide a convenient place to add more instruction lowering in the future. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-11-19glsl: Add ir_quadop_vector expressionIan Romanick
The vector operator collects 2, 3, or 4 scalar components into a vector. Doing this has several advantages. First, it will make ud-chain tracking for components of vectors much easier. Second, a later optimization pass could collect scalars into vectors to allow generation of SWZ instructions (or similar as operands to other instructions on R200 and i915). It also enables an easy way to generate IR for SWZ instructions in the ARB_vertex_program assembler.
2010-11-15glsl: Rename various ir_* files to lower_* and opt_*.Kenneth Graunke
This helps distinguish between lowering passes, optimization passes, and other compiler code.
2010-10-27Fix build on systems where "python" is python 3.Kenneth Graunke
First, it changes autoconf to use a "python2" binary when available, rather than plain "python" (which is ambiguous). Secondly, it changes the Makefiles to use $(PYTHON) $(PYTHON_FLAGS) rather than calling python directly. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Matthew William Cox <matt@mattcox.ca> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-09-30glsl: Add a lowering pass for texture projection.Eric Anholt
2010-09-17glsl: add pass to lower variable array indexing to conditional assignmentsLuca Barbieri
Currenly GLSL happily generates indirect addressing of any kind of arrays. Unfortunately DirectX 9 GPUs are not guaranteed to support any of them in general. This pass fixes that by lowering such constructs to a binary search on the values, followed at the end by vectorized generation of equality masks, and 4 conditional assignments for each mask generation. Note that this requires the ir_binop_equal change so that we can emit SEQ to generate the boolean masks. Unfortunately, ir_structure_splitting is too dumb to turn the resulting constant array references to individual variables, so this will need to be added too before this pass can actually be effective for temps. Several patches in the glsl2-lower-variable-indexing were squashed into this commit. These patches fix bugs in Luca's original implementation, and the individual patches can be seen in that branch. This was done to aid bisecting in the future. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-13glsl2: Add pass to remove redundant jumpsIan Romanick
2010-09-13glsl: add continue/break/return unification/elimination pass (v2)Luca Barbieri
Changes in v2: - Base class renamed to ir_control_flow_visitor - Tried to comply with coding style This is a new pass that supersedes ir_if_return and "lowers" jumps to if/else structures. Currently it causes no regressions on softpipe and nv40, but I'm not sure whether the piglit glsl tests are thorough enough, so consider this experimental. It can be asked to: 1. Pull jumps out of ifs where possible 2. Remove all "continue"s, replacing them with an "execute flag" 3. Replace all "break" with a single conditional one at the end of the loop 4. Replace all "return"s with a single return at the end of the function, for the main function and/or other functions This gives several great benefits: 1. All functions can be inlined after this pass 2. nv40 and other pre-DX10 chips without "continue" can be supported 3. nv30 and other pre-DX10 chips with no control flow at all are better supported Note that for full effect we should also teach the unroller to unroll loops with a fixed maximum number of iterations but with the canonical conditional "break" that this pass will insert if asked to. Continues are lowered by adding a per-loop "execute flag", initialized to TRUE, that when cleared inhibits all execution until the end of the loop. Breaks are lowered to continues, plus setting a "break flag" that is checked at the end of the loop, and trigger the unique "break". Returns are lowered to breaks/continues, plus adding a "return flag" that causes loops to break again out of their enclosing loops until all the loops are exited: then the "execute flag" logic will ignore everything until the end of the function. Note that "continue" and "return" can also be implemented by adding a dummy loop and using break. However, this is bad for hardware with limited nesting depth, and prevents further optimization, and thus is not currently performed.
2010-09-09glsl2: Add lowering pass to remove noise opcodesIan Romanick
2010-09-03glsl2: Add module to perform simple loop unrollingIan Romanick
2010-09-03glsl2: Add module to suss out loop control variables from loop analysis dataIan Romanick
This is the next step on the road to loop unrolling
2010-09-03glsl2: Add module to analyze variables used in loopsIan Romanick
This is the first step eventually leading to loop unrolling.
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-24glsl: make 'make clean' work properly.Dave Airlie
this has make clean remove all the objects.
2010-08-22mesa: AC_SUBST the talloc libs/cflags so the ./configure results are saved.Eric Anholt
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
2010-08-13glsl2/Makefile: Add a 'make builtins' target.Kenneth Graunke
This copies over a dummy builtin_functions.cpp and rebuilds a bootstrapped version of the compiler, then uses that to generate the proper list of builtins. Finally, it rebuilds the compiler with the new list. Unfortunately, it's no longer automatic, but at least it works.
2010-08-13glsl2: Rework builtin function generation.Kenneth Graunke
Each language version/extension and target now has a "profile" containing all of the available builtin function prototypes. These are written in GLSL, and come directly out of the GLSL spec (except for expanding genType). A new builtins/ir/ folder contains the hand-written IR for each builtin, regardless of what version includes it. Only those definitions that have prototypes in the profile will be included. The autogenerated IR for texture builtins is no longer written to disk, so there's no longer any confusion as to what's hand-written or generated. All scripts are now in python instead of perl.
2010-08-13glsl2: Add a pass to strip out noop swizzles.Eric Anholt
With the glsl2-965 branch, the optimization of glsl-algebraic-rcp-rcp regressed due to noop swizzles hiding information from ir_algebraic. This cleans up those noop swizzles for us.
2010-08-13glsl2: Add a generic visitor class to call back with pointers to each rvalue.Eric Anholt
I keep copy and pasting this code all over, so consolidate it in one place.
2010-08-13glsl2: Use --nounistd to fix MSVC buildIan Romanick
Also remove the --never-interactive command line option for the preprocessor lexer. This was already done for main compiler lexer.
2010-08-11glsl2: Change command line options passed to flexIan Romanick
Remove --never-interactive because it is already specified in the source using %option. Use -o instead of --outfile. Some of the %option commands may also need to be removed for compatibility with older versions (e.g., 2.5.4) of flex. This should fix bugzilla #29209.
2010-08-11glsl2: Use bison command line option to set prefixIan Romanick
Bison version 2.3 doesn't seem to support %name-prefix in the source. This should fix bugzilla #29207.
2010-08-09glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))Eric Anholt
All the current HW backends transform subtract to adding the negation, so I haven't bothered peepholing it back out in Mesa IR. This allows some subtract of subtract to get removed in ir_algebraic.
2010-08-09glsl2: Add constant propagation.Eric Anholt
Whereas constant folding evaluates constant expressions at rvalue nodes, constant propagation tracks constant components of vectors across execution to replace (possibly swizzled) variable dereferences with constant values, triggering possible constant folding or reduced variable liveness.
2010-08-06glsl2: Move gl_program->InputsRead/OutputsWritten setting to an ir pass.Eric Anholt
This lets us handle arrays much better than trying to work backwards from assembly. Fixes fbo-drawbuffers-maxtargets on swrast (i965 needs loop unrolling)
2010-08-05glsl2: Add a pass to convert exp and log to exp2 and log2.Eric Anholt
Fixes ir_to_mesa handling of unop_log, which used the weird ARB_vp LOG opcode that doesn't do what we want. This also lets the multiplication coefficients in there get constant-folded, possibly. Fixes: glsl-fs-log
2010-08-05ir_structure_splitting: New pass to chop structures into their components.Eric Anholt
This doesn't do anything if your structure goes through an uninlined function call or if whole-structure assignment occurs. As such, the impact is limited, at least until we do some global copy propagation to reduce whole-structure assignment.
2010-08-05glsl2: Add a pass for removing unused functions.Eric Anholt
For a shader involving many small functions, this avoids running optimization across all of them after they've been inlined post-linking. Reduces the runtime of linking and running a fragment shader from Yo Frankie from 1.6 seconds to 0.9 seconds (-44.9%, +/- 3.3%).
2010-08-04glcpp: Remove xtalloc wrappers in favor of plain talloc.Kenneth Graunke
Calling exit() on a memory failure probably made sense for the standalone preprocessor, but doesn't seem too appealing as part of the GL library. Also, we don't use it in the main compiler.
2010-08-02glsl2: Don't add mesa/program/ as an include dir. Let includes say program/.Eric Anholt
2010-07-31glsl2: Add new tree grafting optimization pass.Eric Anholt
2010-07-31glsl2: Factor out the variable refcounting part of ir_dead_code.cpp.Eric Anholt
2010-07-28glsl2/Makefile: Append to DEFINES rather than replacing them.Kenneth Graunke
Otherwise, we lose DEBUG, which causes mtypes.h to set NDEBUG, which causes assertions to not happen, which is no fun for anyone.
2010-07-27glsl2: Add optimization pass for algebraic simplifications.Eric Anholt
This cleans up the assembly output of almost all the non-logic tests glsl-algebraic-*. glsl-algebraic-pow-two needs love (basically, flattening to a temporary and squaring it).
2010-07-26Merge remote branch 'origin/master' into glsl2Eric Anholt
This pulls in multiple i965 driver fixes which will help ensure better testing coverage during development, and also gets past the conflicts of the src/mesa/shader -> src/mesa/program move. Conflicts: src/mesa/Makefile src/mesa/main/shaderapi.c src/mesa/main/shaderobj.h