Commit graph

33 commits

Author SHA1 Message Date
Marek Olšák
5ba2e7adf0 mesa: implement AMD_shader_stencil_export
It's just an alias of the ARB variant with some GLSL compiler changes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-03 12:03:22 +02:00
José Fonseca
28f1d6ab49 glsl: Add void to _mesa_destroy_shader_compiler() argument list.
At least MSVC sees a distinction between foo() and foo(void) and warns
about it.
2011-03-25 16:22:34 +00:00
Kenneth Graunke
0a163cf56d glsl: Enable GL_OES_texture_3D extension for ES2. 2011-02-28 10:35:57 -08:00
Ian Romanick
497baf4e4a Use C-style system headers in C++ code to avoid issues with std:: namespace 2011-02-21 13:07:29 -08:00
Ian Romanick
14880a510a glsl: Reject shader versions not supported by the implementation
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-31 15:32:56 -08:00
Kenneth Graunke
d3073f58c1 Convert everything from the talloc API to the ralloc API. 2011-01-31 10:17:09 -08:00
Chad Versace
fb5db0570c glsl: Add support for AMD_conservative_depth to parser
When AMD_conservative_depth is enabled:
* Let 'layout' be a token.
* Extend the production rule of layout_qualifier_id to process the tokens:
   depth_any
   depth_greater
   depth_less
   depth_unchanged
2011-01-26 16:37:44 -08:00
Brian Paul
652901e95b Merge branch 'draw-instanced'
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
2011-01-15 10:24:08 -07:00
Ian Romanick
eebdfdfbcf glsl: Add version_string containing properly formatted GLSL version 2011-01-10 17:39:16 -08:00
Ian Romanick
86b4398cd1 glsl: Support the 'invariant(all)' pragma
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
simply ignored by the compiler.  This adds support for setting all
variable invariant.

In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
but a warning is generated.

Fixes piglit test glsl-invariant-pragma and bugzilla #31925.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-06 10:49:56 -08:00
Brian Paul
7ce186358e glsl: add support for system values and GL_ARB_draw_instanced 2010-12-08 18:25:38 -07:00
Kenneth Graunke
a75da2c0e8 glsl: Remove useless ir_shader enumeration value. 2010-10-20 15:07:47 -07:00
Kristian Høgsberg
f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Dave Airlie
d9671863ea glsl: add support for shader stencil export
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-13 09:30:05 +10:00
Ian Romanick
7f68cbdc4d glsl: Add parser support for GL_ARB_explicit_attrib_location layouts
Only layout(location=#) is supported.  Setting the index requires GLSL
1.30 and GL_ARB_blend_func_extended.
2010-10-08 14:21:22 -07:00
Kenneth Graunke
7dcfc44b72 glsl: Define GL_ES preprocessor macro if API is OpenGL ES 2.0.
Also define it if #version 100 is encountered.
2010-09-07 17:30:37 -07:00
Kenneth Graunke
719caa403e glsl: Accept language version 100 and make it the default on ES2. 2010-09-07 17:30:37 -07:00
Brian Paul
b820bf979a glsl2: restructure header file for C++ and C inclusion
As it was, the header could not be cleanly #included by a C source.
2010-08-27 14:30:59 -06:00
Eric Anholt
b83846475b glsl2: Free the shader compiler at dri screen destruction.
Hooray, we can valgrind again without adding suppressions.  This also
adds an interface for use by an implementation of
glReleaseShaderCompiler().
2010-08-18 17:10:48 -07:00
Eric Anholt
e271384219 glsl: Garbage collect old prototype for ir_to_mesa. 2010-08-18 14:16:07 -07:00
Ian Romanick
f50f06552e glsl2: Parser support for GL_ARB_fragment_coord_conventions 2010-07-28 14:14:38 -07:00
Eric Anholt
2d1ed7b1b1 glsl2: When a "continue" happens in a "for" loop, run the loop expression.
Fixes:
glsl1-for-loop with continue

Bug #29097
2010-07-22 13:02:40 -07:00
Ian Romanick
d5be2acae3 linker: Link built-in functions instead of including them in every shader
This is an invasive set of changes.  Each user shader tracks a set of other
shaders that contain built-in functions.  During compilation, function
prototypes are imported from these shaders.  During linking, the
shaders are linked with these built-in-function shaders just like with
any other shader.
2010-07-21 15:52:58 -07:00
Carl Worth
a0cfe8c440 glsl: Fix missing initialization of yylloc.source
In both the preprocessor and in the compiler proper, we use a custom
yyltype struct to allow tracking the source-string number in addition
to line and column. However, we were previously relying on bison's
default initialization of the yyltype struct which of course is not
aware of the source field and leaves it uninitialized.

We fix this by defining our own YYLLOC_DEFAULT macro expanding on the
default version (as appears in the bison manual) and adding
initialization of yylloc.source.
2010-07-21 13:52:33 -07:00
Ian Romanick
2462a536ea glsl2: Add a constructor for _mesa_glsl_parse_state
Coming changes to the handling of built-in functions necessitate this.
2010-07-20 17:48:24 -07:00
Eric Anholt
f8946699ec glsl2: Add definitions of the builtin constants present in GLSL 1.10.
Fixes:
glsl1-built-in constants
2010-07-20 14:03:35 -07:00
Kenneth Graunke
dfd30ca6a9 glsl2: Remove generate_temporary and global temporary counter.
Most places in the code simply use a static name, which works because
names are never used to look up an ir_variable.  generate_temporary is
simply unnecessary (and looks like it would leak memory, and isn't
thread safe...)
2010-07-08 15:44:19 -07:00
Ian Romanick
667f4e1940 glsl2: Conditionally allow optional extensions to be enabled
The only optional extension currently supported by the compiler is
GL_EXT_texture_array.
2010-07-01 20:40:08 -07:00
Ian Romanick
06143ea094 glsl2: Conditionally define preprocessor tokens for optional extensions
The only optional extension currently supported by the compiler is
GL_EXT_texture_array.
2010-07-01 20:40:08 -07:00
Ian Romanick
127308b4be glsl2: Add gl_MaxTextureCoords 2010-07-01 13:30:50 -07:00
Ian Romanick
5e18b051c0 glsl2: Pass MaxDrawBuffers from core Mesa into the GLSL compiler 2010-06-29 15:19:38 -07:00
Kenneth Graunke
6de8256505 glsl2: Check for non-void functions that don't have a return statement.
This doesn't do any control flow analysis to ensure that the return
statements are actually reached.

Fixes piglit tests function5.frag and function-07.vert.
2010-06-29 11:12:54 -07:00
Eric Anholt
2928588267 glsl2: Move the compiler to the subdirectory it will live in in Mesa. 2010-06-24 15:36:00 -07:00
Renamed from glsl_parser_extras.h (Browse further)