summaryrefslogtreecommitdiff
path: root/src/glsl/glsl_parser_extras.cpp
AgeCommit message (Collapse)Author
2011-02-28glsl: Enable GL_OES_texture_3D extension for ES2.Kenneth Graunke
2011-02-08glsl: Disable the new copy propagation pass until it gets fixed.Eric Anholt
It apparently regressed a bunch of ES2 cases.
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-02-01glsl: Fix memory error when creating the supported version string.Kenneth Graunke
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.
2011-01-31glsl: Reject shader versions not supported by the implementationIan Romanick
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
2011-01-31Convert everything from the talloc API to the ralloc API.Kenneth Graunke
2011-01-26glsl: Enable AMD_conservative_depth in parserChad Versace
All the necessary compiler infrastructure for AMD_conservative_depth is in place, so it's safe to enable it in the parser.
2011-01-18glsl: Skip the rest of loop unrolling if no loops were found.Eric Anholt
Shaves 1.6% (+/- 1.0%) off of ff_fragment_shader glean texCombine time (n=5).
2011-01-15Merge branch 'draw-instanced'Brian Paul
Conflicts: src/gallium/auxiliary/draw/draw_llvm.c src/gallium/drivers/llvmpipe/lp_state_fs.c src/glsl/ir_set_program_inouts.cpp src/mesa/tnl/t_vb_program.c
2010-12-08glsl: add support for system values and GL_ARB_draw_instancedBrian Paul
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-10-20glsl: Remove useless ir_shader enumeration value.Kenneth Graunke
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg
2010-10-13glsl: add support for shader stencil exportDave Airlie
This adds proper support for the GL_ARB_shader_stencil_export extension to the GLSL compiler. Thanks to Ian for pointing out where I need to add things.
2010-10-08glsl: Add parser support for GL_ARB_explicit_attrib_location layoutsIan Romanick
Only layout(location=#) is supported. Setting the index requires GLSL 1.30 and GL_ARB_blend_func_extended.
2010-10-08glsl: Wrap ast_type_qualifier contents in a struct in a unionIan Romanick
This will ease adding non-bit fields in the near future.
2010-09-18glsl: Properly handle nested structure types.Kenneth Graunke
Fixes piglit test CorrectFull.frag.
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-08glsl: add several EmitNo* options, and MaxUnrollIterationsLuca Barbieri
This increases the chance that GLSL programs will actually work. Note that continues and returns are not yet lowered, so linking will just fail if not supported. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-08glsl: Require a context in _mesa_glsl_parse_state.Chia-I Wu
Create a dummy context in the standalone compiler and pass it to _mesa_glsl_parse_state.
2010-09-07glsl: Accept language version 100 and make it the default on ES2.Kenneth Graunke
2010-09-07glsl: Set default language version in mesa_glsl_parse_state constructor.Kenneth Graunke
This should make it easier to change the default version based on the API (say, version 1.00 for OpenGL ES). Also, synchronize the symbol table's version with the parse state's version just before doing AST-to-HIR. This way, it will be set when it matters, but the main initialization code doesn't have to care about the symbol table.
2010-09-03glsl2: Add module to perform simple loop unrollingIan Romanick
2010-09-03glsl2: Perform initial bits of loop analysis during compilationIan Romanick
2010-08-24glsl: Include main/core.h.Chia-I Wu
Make glsl include only main/core.h from core mesa.
2010-08-18glsl2: Free the shader compiler at dri screen destruction.Eric Anholt
Hooray, we can valgrind again without adding suppressions. This also adds an interface for use by an implementation of glReleaseShaderCompiler().
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: Move the common optimization passes to a helper function.Eric Anholt
These are passes that we expect all codegen to be happy with. The other lowering passes for Mesa IR are moved to the Mesa IR generator.
2010-08-05glsl2: Enable all supported extensions in stand-alone compilerIan Romanick
2010-07-30ast: Initialize location data in constructor of all ast_node objects.Carl Worth
This prevents using uninitialized data in _msea_glsl_error in some cases, (including at least 6 piglit tests). Thanks to valgrind for pointing out the problem!
2010-07-28glsl2: Parser support for GL_ARB_fragment_coord_conventionsIan Romanick
2010-07-22glsl2: Fix standalone compiler to not crash horribly.Kenneth Graunke
ir_to_mesa was updated for the _mesa_glsl_parse_state constructor changes, but main.cpp was not.
2010-07-20glsl2: Add a constructor for _mesa_glsl_parse_stateIan Romanick
Coming changes to the handling of built-in functions necessitate this.
2010-07-18glsl2: Fix warning from always-false assert not being known to not return.Eric Anholt
2010-07-01glsl2: Conditionally allow optional extensions to be enabledIan Romanick
The only optional extension currently supported by the compiler is GL_EXT_texture_array.
2010-07-01glsl2: Initialize ast_declarator_list::invariant in constructorIan Romanick
2010-06-24glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt