summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Remove useless ir_shader enumeration value.Kenneth Graunke2010-10-201-1/+0
|
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-2/+2
|
* glsl: add support for shader stencil exportDave Airlie2010-10-131-0/+8
| | | | | 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.
* glsl: Add parser support for GL_ARB_explicit_attrib_location layoutsIan Romanick2010-10-081-0/+7
| | | | | Only layout(location=#) is supported. Setting the index requires GLSL 1.30 and GL_ARB_blend_func_extended.
* glsl: Wrap ast_type_qualifier contents in a struct in a unionIan Romanick2010-10-081-12/+12
| | | | This will ease adding non-bit fields in the near future.
* glsl: Properly handle nested structure types.Kenneth Graunke2010-09-181-0/+5
| | | | Fixes piglit test CorrectFull.frag.
* glsl2: Add pass to remove redundant jumpsIan Romanick2010-09-131-0/+2
|
* glsl: add continue/break/return unification/elimination pass (v2)Luca Barbieri2010-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* glsl: add several EmitNo* options, and MaxUnrollIterationsLuca Barbieri2010-09-081-2/+2
| | | | | | | | | 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 <[email protected]>
* glsl: Require a context in _mesa_glsl_parse_state.Chia-I Wu2010-09-081-56/+21
| | | | | Create a dummy context in the standalone compiler and pass it to _mesa_glsl_parse_state.
* glsl: Accept language version 100 and make it the default on ES2.Kenneth Graunke2010-09-071-0/+8
|
* glsl: Set default language version in mesa_glsl_parse_state constructor.Kenneth Graunke2010-09-071-0/+3
| | | | | | | | | | 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.
* glsl2: Add module to perform simple loop unrollingIan Romanick2010-09-031-0/+1
|
* glsl2: Perform initial bits of loop analysis during compilationIan Romanick2010-09-031-0/+5
|
* glsl: Include main/core.h.Chia-I Wu2010-08-241-1/+1
| | | | Make glsl include only main/core.h from core mesa.
* glsl2: Free the shader compiler at dri screen destruction.Eric Anholt2010-08-181-0/+30
| | | | | | Hooray, we can valgrind again without adding suppressions. This also adds an interface for use by an implementation of glReleaseShaderCompiler().
* glsl2: Add a pass to strip out noop swizzles.Eric Anholt2010-08-131-0/+1
| | | | | | 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.
* glsl2: Move the common optimization passes to a helper function.Eric Anholt2010-08-131-0/+35
| | | | | 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.
* glsl2: Enable all supported extensions in stand-alone compilerIan Romanick2010-08-051-0/+5
|
* ast: Initialize location data in constructor of all ast_node objects.Carl Worth2010-07-301-1/+3
| | | | | | 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!
* glsl2: Parser support for GL_ARB_fragment_coord_conventionsIan Romanick2010-07-281-0/+7
|
* glsl2: Fix standalone compiler to not crash horribly.Kenneth Graunke2010-07-221-0/+23
| | | | | ir_to_mesa was updated for the _mesa_glsl_parse_state constructor changes, but main.cpp was not.
* glsl2: Add a constructor for _mesa_glsl_parse_stateIan Romanick2010-07-201-0/+41
| | | | Coming changes to the handling of built-in functions necessitate this.
* glsl2: Fix warning from always-false assert not being known to not return.Eric Anholt2010-07-181-0/+1
|
* glsl2: Conditionally allow optional extensions to be enabledIan Romanick2010-07-011-0/+6
| | | | | The only optional extension currently supported by the compiler is GL_EXT_texture_array.
* glsl2: Initialize ast_declarator_list::invariant in constructorIan Romanick2010-07-011-0/+1
|
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+621