Commit Graph

2496 Commits

Author SHA1 Message Date
Ian Romanick 6f0823da09 glsl2: Support AST-to-IR translation of invariant keyword 2010-07-01 20:39:08 -07:00
Ian Romanick 3832706f81 glsl2: Initialize ast_declarator_list::invariant in constructor 2010-07-01 17:10:11 -07:00
Ian Romanick 12873fa4e3 glsl2: Don't bounds check unsize array redeclarations
This along with several previous commits fix test CorrectUnsizedArray.frag.
2010-07-01 14:10:19 -07:00
Ian Romanick 127308b4be glsl2: Add gl_MaxTextureCoords 2010-07-01 13:30:50 -07:00
Ian Romanick cd00d5b88c glsl2: Default delcaration of gl_TexCoord is unsized 2010-07-01 13:17:54 -07:00
Ian Romanick 5466b63968 glsl2: Change order of semaintic checks on variable declarations
This will make it easier to support more (valid) kinds of redeclarations.
2010-07-01 12:56:49 -07:00
Eric Anholt d1b07167b9 glsl2: Update README for what I've been thinking about with expr types work. 2010-07-01 11:07:58 -07:00
Eric Anholt 8a1f186cc5 glsl2: Add a pass to convert mod(a, b) to b * fract(a/b).
This is used by the Mesa IR backend to implement mod, fixing glsl-fs-mod.
2010-07-01 11:07:23 -07:00
Eric Anholt 9acf618f24 glsl2: Remove dead member from dead code visitor. 2010-07-01 11:07:22 -07:00
Eric Anholt d925c91730 glsl2: Add ir_unop_fract as an expression type.
Most backends will prefer seeing this to seeing (a - floor(a)), so
represent it explicitly.
2010-07-01 11:07:22 -07:00
Eric Anholt f5b3b2a01a glsl2: Don't break sign() down by vector components. 2010-06-30 17:29:12 -07:00
Eric Anholt 02d615306e glsl2: Fix reversed value of step().
It's 0.0 if x < edge, not 1.0.  Partial fix for glsl-fs-step.
2010-06-30 16:23:15 -07:00
Eric Anholt 4e16a7b526 glsl2: Fix up the implementation of fract() for vector types.
There's no need to split each vector component out, just do vector ops.
2010-06-30 15:59:07 -07:00
Kenneth Graunke 77049a702a glsl2: Implement AST->HIR support for the "discard" instruction. 2010-06-30 14:54:58 -07:00
Kenneth Graunke 16efab1c4d glsl2: Define new ir_discard instruction. 2010-06-30 14:54:58 -07:00
Eric Anholt 97eba76b8c glsl2: Allow a fragment shader to not write a color.
I can't find any text justifying this check, and it caused a
reasonable-looking shader in glsl-bug-22603 (which writes only
gl_FragDepth) to fail.
2010-06-30 14:51:50 -07:00
Kenneth Graunke c7f4ff193a glsl2: Fix storing of dead memory in the symbol table.
decl->identifier is part of the AST, so it doesn't live very long.
Instead, add var->name which is owned by var.
2010-06-30 13:52:24 -07:00
Kenneth Graunke 629198b96a glsl2: Preprocessed source doesn't need to live past compile time. 2010-06-30 13:52:24 -07:00
Kenneth Graunke c6099a65f8 glsl2: Create new talloc contexts the "right" way. 2010-06-30 13:52:24 -07:00
Kenneth Graunke 953ff1283d glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.
_mesa_glsl_parse_state should be the parent for all temporary allocation
done while compiling a shader.  glsl_shader should only be used as the
parent for the shader's final IR---the _result_ of compilation.

Since many IR instructions may be added or discarded during optimization
passes, IR should not ever be allocated to glsl_shader directly.

Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g.

This also removes a ton of talloc_parent calls, which may help performance.
2010-06-30 13:52:24 -07:00
Kenneth Graunke 116f1d4f95 glsl2: Steal the live IR and free the rest of the junk. 2010-06-30 13:52:24 -07:00
Ian Romanick ef5f194831 linker: Don't dynamically allocate slots for linked shaders
The can be at most one shader per stage.  There are currently only two
stages.  There is zero reason to dynamically size this array.
2010-06-30 12:20:44 -07:00
Ian Romanick 982e3798d8 linker: Don't automatically allocate VERT_ATTRIB_GENERIC0 2010-06-30 12:02:11 -07:00
Eric Anholt 849e18153c glsl2: Use Mesa's gl_shader_program instead of our own struct glsl_program.
This avoids more allocation and shuffling of data around.
2010-06-30 12:01:42 -07:00
Eric Anholt 0eda9ae0a6 glsl2: Make function names and variable names be children of the node.
This avoids losing their memory when the parser state is freed.
2010-06-30 11:52:40 -07:00
Eric Anholt 16b68b1952 glsl2: Move our data from a glsl_shader* on the side to the main gl_shader *.
This saves recompiling at link time.  gl_shader->ir is made a pointer
so that we don't have to bring exec_list into mtypes.h.
2010-06-30 11:30:26 -07:00
Zack Rusin 0d68d01347 mesa: make the arguments in the asm statemants optional
geometry shaders emit/end functions don't take any arguments
2010-06-29 21:45:41 -04:00
Eric Anholt d4f7e660dd ir_to_mesa: Start adding support for texture instructions.
Fixes:
glsl-fs-bug25902
glsl-fs-sampler-numbering
glsl-lod-bias
2010-06-29 17:18:28 -07:00
Kenneth Graunke 506199b852 glsl2: Keep the same number of components in implicit conversions.
Fixes piglit test glsl-implicit-conversion-01.
2010-06-29 16:31:52 -07:00
Ian Romanick 22971e922a glsl2: Make gl_MaxDrawBuffers available in the vertex shader 2010-06-29 15:32:19 -07:00
Ian Romanick e2f84f04e5 glsl2: Make gl_MaxDrawBuffers available in the fragment shader 2010-06-29 15:32:15 -07:00
Ian Romanick 9c4b1f2bad glsl2: Make gl_FragData be available in GLSL 1.10 too 2010-06-29 15:19:42 -07:00
Ian Romanick 5e18b051c0 glsl2: Pass MaxDrawBuffers from core Mesa into the GLSL compiler 2010-06-29 15:19:38 -07:00
Ian Romanick efc15f862b glsl_type: Add _mesa_glsl_release_types to release all type related storage 2010-06-29 11:15:40 -07:00
Ian Romanick e1374d48de glsl_type: All glsl_type objects live in their own talloc context 2010-06-29 11:15:40 -07:00
Ian Romanick 72e627d02a glsl_type: Record type constructors are private 2010-06-29 11:15:39 -07:00
Ian Romanick 49e3577b91 glsl_type: Add get_record_instance method 2010-06-29 11:15:39 -07:00
Ian Romanick 31bcce04b1 glsl_type: Vector, matrix, and sampler type constructors are private 2010-06-29 11:15:39 -07:00
Ian Romanick e94642eb0d glsl_type: Make all static objects be class private 2010-06-29 11:15:39 -07:00
Ian Romanick 4b6feb0398 glsl2: Use talloc_strdup when generating constructor temporary names 2010-06-29 11:15:26 -07:00
Ian Romanick 12681610f5 glsl_type: Remove vector and matrix constructor generators
All scalar, vector, and matrix constructors are generated in-line
during AST-to-HIR translation.  There is no longer any need to
generate function versions of the constructors.
2010-06-29 11:15:26 -07:00
Ian Romanick 699b247661 glsl2: Don't flatten constructor parameters to scalars
Now that all scalar, vector, and matrix constructors are emitted
in-line, the parameters to these constructors should not be flattened
to a pile of scalars.  Instead, the functions that emit the in-line
constructor bodies can directly write the parameters to the correct
locations in the objects being constructed.
2010-06-29 11:15:26 -07:00
Ian Romanick 81c7e94466 glsl2: Always emit matrix constructors inline 2010-06-29 11:15:26 -07:00
Ian Romanick c31dcdf57e glsl2: Always emit vector constructors inline 2010-06-29 11:15:26 -07:00
Ian Romanick 6315b68f5f ir_swizzle: Add new constructor, refactor constructors
Adds a new constructor that takes an array of component values.  Refactors
the meat of the two constructors to an init_mask method.
2010-06-29 11:15:26 -07:00
Kenneth Graunke 50577b96ac glsl2: Update TODO. 2010-06-29 11:12:54 -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
Kenneth Graunke ac04c257e3 glsl2: Reject return types with qualifiers.
Fixes piglit test return-qualifier.frag.
2010-06-29 11:12:54 -07:00
Kenneth Graunke 28527ed557 glsl2: Add a method for querying if an AST type has any qualifiers. 2010-06-29 11:12:53 -07:00
Kenneth Graunke 18707eba1c glsl2: Check that returned expressions match the function return type.
From my reading of the specification, implicit conversions are not
allowed.  ATI seems to agree, though nVidia allows it without warning.
2010-06-29 11:12:53 -07:00
Zack Rusin da7bd6a90e mesa: initial support for ARB_geometry_shader4
laying down the foundation for everything and implementing most of the
stuff.
linking, gl_VerticesIn and multidimensional inputs are left.
2010-06-28 22:53:21 -04:00
Kenneth Graunke 5f3fe44595 Use a more sensible context in copy propagation. 2010-06-28 11:14:47 -07:00
Kenneth Graunke a815f7fb83 Use more sensible contexts in ir_dead_code_local. 2010-06-28 11:14:47 -07:00
Ian Romanick 22c23dedad glsl2: Add option to stand-alone GLSL compiler to dump IR before optimizations 2010-06-28 10:04:22 -07:00
Ian Romanick 26b5d33dce glsl2: Use i2b and f2b IR opcodes for casting int or float to bool 2010-06-28 10:04:18 -07:00
Kenneth Graunke 78062273de ir_reader: Free memory for S-Expressions earlier.
There's no point in keeping it around once we've read the IR.

Also, remove an unnecessary talloc_parent call.
2010-06-25 17:07:42 -07:00
Eric Anholt 0fd97db8b0 glsl2: Associate the GLenum for the type with builtin GLSL types. 2010-06-25 16:35:22 -07:00
Eric Anholt bda27424cf glsl2: Use the parser state as the talloc context for dead code elimination.
This cuts runtime by around 20% from talloc_parent() lookups.
2010-06-25 13:38:38 -07:00
Eric Anholt 364fcd8ee1 glsl2: Start integrating ir_to_mesa.cpp into shader_api.h
The compiler is now called by the driver, and generates program
instructions.  Parameter lists are still not set up, so the driver
chokes on it shortly thereafter.
2010-06-25 12:37:21 -07:00
Eric Anholt 7f2bf62d25 glsl2: Use Mesa types instead of duping them into our program.h. 2010-06-25 12:25:19 -07:00
Eric Anholt 2a3d46dd46 glsl2: Fix dependencies. (at least partially) 2010-06-25 12:23:20 -07:00
Eric Anholt 0a1b54df7a glsl2: Replace the GLSL compiler with the glsl2 project. 2010-06-24 17:23:21 -07:00
Eric Anholt 3d6012303c glsl2: Wrap includes of C interfaces with extern "C". 2010-06-24 17:23:19 -07:00
Eric Anholt f4869f3326 glsl2: Remove files that had been imported for standalone. 2010-06-24 17:14:00 -07:00
Eric Anholt e82ddb781a glsl2: Stop .gitignoring the old standalone build system. 2010-06-24 15:52:56 -07:00
Eric Anholt 9aa0b6d728 glsl2: Move the Mesa IR codegen into mesa/shader/ 2010-06-24 15:49:18 -07:00
Eric Anholt bcc13b7444 Merge branch 'glsl2-head' into glsl2
This brings in the standalone GLSL compiler that we are planning on
replacing the existing Mesa GLSL compiler.  It currently targets GLSL
1.20 and the Mesa IR.
2010-06-24 15:47:40 -07:00
Eric Anholt e5cf3aadb8 glsl2: Add a README file for the new compiler. 2010-06-24 15:46:53 -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
Kristian Høgsberg a663a63718 glsl: Recject rect samplers when GL_ARB_texture_rectangle is disabled 2010-06-04 09:06:34 -04:00
Brian Paul 1f2b495b55 glsl: implement support for GL_EXT_texture_array
GL_EXT_texture_array is different from the existing GL_MESA_texture_array
support in that the former is only supported for GLSL, not fixed-function.

The shadow compare versions of the sampler functions haven't been tested
yet.  The non-shadow versions have been tested with a new piglit test.
2010-02-25 20:11:55 -07:00
Vinson Lee 83a5b7e468 glsl/apps: Assert that ftell does not return an error. 2010-02-22 23:49:50 -08:00
Vinson Lee d1aafb33b5 glsl/cl: Prevent possible buffer overflow. 2010-02-21 00:36:50 -08:00
Vinson Lee ae41339d4c glsl/cl: Prevent possible string overflow. 2010-02-20 23:27:07 -08:00
Brian Paul 5b392ff49a glsl/apps: print usage info if insufficient args 2010-02-17 08:59:02 -07:00
Michal Krol cb66e9f2b4 glsl/pp: Remove sl_pp_get_extension_state().
Parse extension tokens to track current state of extension enables.
2010-02-17 11:22:01 +01:00
Michal Krol 27a68bd14a glsl/cl: Parse layout qualifiers only when an appropriate extension enabled. 2010-02-17 11:21:59 +01:00
Michal Krol a21215a74e glsl/cl: Properly emit layout qualifier list. 2010-02-17 11:21:58 +01:00
Brian Paul de5928a615 sl/pp: re-do extension testing code
The #extension directive should not effect which extension preprocessor
symbols are defined/undefined; only whether/how the compiler accepts
language features defined by the extension.
2010-02-16 10:43:36 -07:00
Michal Krol fa8acb0528 glsl/pp: Do not try to enable extension `all'. 2010-02-16 10:04:58 +01:00
Michal Krol ee67167358 glsl/pp: Fix handling of if/elif/else cases.
Once if/elif evalutes to true, all subsequent conditions are always false.
2010-02-15 21:33:22 +01:00
Vinson Lee f0e1499805 glsl/pp: Add asserts to check for null pointer deferences. 2010-02-15 00:30:31 -08:00
Brian Paul 46f788c2e5 glsl/cl: implement parsing for layout qualifiers
For GL_ARB_fragment_coord_conventions support.
2010-02-13 13:50:45 -07:00
Brian Paul 3b53b7e8b0 glsl/pp: fix incorrect extension enable flag for warn mode 2010-02-13 13:48:32 -07:00
Brian Paul 3251f31d59 glsl/pp: fix extension enable/disable options
Now the #extension name: disable/enable flags do the right thing.

Fixes glean/glsl1 "Preprocessor test (extension test 3)"
2010-02-10 10:49:50 -07:00
Michal Krol 8b1c332a77 Simplify GLSL extension mechanism.
Since extension name and extension name string are the same, collapse
them into one name.
2010-02-10 18:04:07 +01:00
Michal Krol c1395a71ac glsl/pp: Fix ifdef directive for extension names. 2010-02-10 17:55:29 +01:00
Vinson Lee c73dbce891 glsl/pp: Silence GCC "no previous prototype" warning. 2010-01-26 00:47:31 -08:00
Brian Paul 4c041fac96 glsl: remove __inline directive
It makes no difference with gcc -O3, for example.
2010-01-18 11:06:57 -07:00
José Fonseca cbb23523a8 glsl: Ignore programs. 2010-01-01 12:16:19 +00:00
Brian Paul 561a107df7 glsl: added default case in _fetch_token() to silence warnings 2009-12-29 08:47:40 -07:00
José Fonseca 7abdaf574a scons: Fix xlib build.
After glsl rework merge.
2009-12-28 22:53:40 +00:00
Keith Whitwell b2a615e3cd glsl/pp: move static functions out of header file 2009-12-23 16:10:37 +00:00
Keith Whitwell cdd25ab8cf glsl/pp: quieten compiler about missing case statements 2009-12-23 16:10:37 +00:00
Dave Airlie 55c43ee315 glsl: make stack compile.
it would be nice if this stuff would be test built on mesa's primary
platform with mesa's primary build system.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-21 09:10:21 +10:00
Michal Krol 1071ad70f5 glsl/apps: Update after glsl cl interface changes. 2009-12-20 21:19:10 +01:00
Michal Krol d801c296c6 glsl: Do syntax parsing inline with processing. 2009-12-20 21:19:07 +01:00
Michal Krol 9c15948125 glsl/apps: Update after glsl pp interface changes. 2009-12-20 21:19:03 +01:00
Michal Krol e0f57a37b2 glsl/apps: Do not print number of eaten tokens in version.
This is due to the glsl pp interface changes.
2009-12-20 21:19:02 +01:00
Michal Krol 0874ce48a6 glsl/apps: Print error line number in compile. 2009-12-20 21:19:01 +01:00
Michal Krol d696cb279d glsl/pp: Do processing inline with tokenisation. 2009-12-20 21:18:59 +01:00
Michal Krol 7631dca25b glsl/pp: Remove outdated TODO.
Already implemented in mesa compiler using predefined symbols.
2009-12-20 21:18:58 +01:00
Michal Krol e9aa65d2b7 glsl/pp: Report correct error line for purify and tokeniser errors. 2009-12-20 21:18:57 +01:00
Sedat Dilek 294bd53d4b glsl/apps: Add dummy install target to fix 'make install'
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-12-17 12:46:55 -07:00
José Fonseca 491f384c39 scons: Get GLSL code building correctly when cross compiling.
This is quite messy. GLSL code has to be built twice: one for the
host OS, another for the target OS.
2009-12-10 16:30:08 +00:00
Brian Paul 289eab5389 glsl/sl: fix _parse_boolconstant()
Need to emit the radix before the digits.
This fixes several glean/glgl1 regressions.
2009-12-10 09:16:39 -07:00
Brian Paul 05eccfe79e glsl/apps: remove unused vars 2009-12-10 08:25:47 -07:00
Brian Paul 0d654a7f2c glsl/pp: make some functions static 2009-12-10 08:25:35 -07:00
Brian Paul 52271c5345 glsl/pp: declare sl_pp_purify_options to silence warning 2009-12-10 08:25:16 -07:00
Brian Paul 7502b6affa glsl/cl: silence unused var warning 2009-12-10 08:24:45 -07:00
Michal Krol 417f36ccb0 glsl/apps: Predefine __GLSL_PP_PREDEFINED_MACRO_TEST for testing. 2009-12-10 12:58:44 +01:00
Michal Krol 22200bcafc glsl/pp: Add support for user-defined macros. 2009-12-10 12:58:21 +01:00
Michal Krol d1a09a9ba4 glsl/apps: Explicitly add ARB_draw_buffers and ARB_texture_rectangle. 2009-12-10 12:39:37 +01:00
Michal Krol 91e164b3d0 glsl/pp: Add sl_pp_context_add_extension().
This way third parties are able to add supported extension strings.
2009-12-10 12:38:22 +01:00
michal 068596c9a7 Build mesa glsl with make.
Still don't know how to add glsl to mesa dependencies.
2009-12-10 01:03:15 +01:00
Michal Krol 77a0a3e5ca glsl/apps: Make compile more shell friendly. 2009-11-25 14:59:29 +01:00
Michal Krol 3371f7e502 scons: Autogenerate GLSL builtin library *_gc.h from *.gc files. 2009-11-25 14:52:21 +01:00
Michal Krol 6199a0cf89 glsl/apps: No need to purify source text for tokeniser. 2009-11-21 20:44:16 +01:00
Michal Krol abe1f33298 glsl/pp: Do purification and tokenisation in a single step. 2009-11-21 20:41:48 +01:00
Michal Krol b89cd8afc5 glsl/pp: Expand unknown identifiers to 0 in if/elif expressions. 2009-11-20 08:59:50 +01:00
Michal Krol 547ac2869b glsl/pp: Fix macro formal argument parsing, more descriptive error msgs. 2009-11-17 09:06:53 +01:00
Michal Krol eaa34c2dea glsl/apps: Report syntax parser errors. 2009-11-13 19:51:49 +01:00
Michal Krol 99c89ebdb0 glsl/cl: Add simple error reporting. 2009-11-13 19:51:02 +01:00
Michal Krol 38a1f0b5d1 glsl/apps: Add GLSL compiler that translates source text into binary stream.
Should be used in place of gc_to_bin utility to precompile builtin library.
2009-11-13 03:02:14 +01:00
Michal Krol 08e90bdea1 glsl/cl: Add a hard-coded syntax parser. 2009-11-13 03:00:45 +01:00
Michal Krol d44cebd1ee glsl/pp: Add sl_pp_purify_getc(). 2009-11-10 20:49:45 +01:00
Michal Krol b5c8c87eab glsl/apps: Update for glsl/pp interface changes. 2009-11-10 00:15:54 +01:00
Michal Krol d37f7694b6 glsl/pp: Have sl_pp_purify() return error msg/line no. 2009-11-10 00:15:33 +01:00
Michal Krol c4bd6ccde8 glsl/pp: Expand macro actual arguments before pasting into its body. 2009-09-28 11:30:15 +02:00
Michal Krol 92e33569f3 glsl/pp: Add forward decls to silence gcc warnings. 2009-09-24 10:57:55 +02:00
Michal Krol 69fec23251 glsl/pp: Avoid using `__VERSION__' as an identifier. 2009-09-24 10:57:32 +02:00
Michal Krol 7a95a3c7c4 glsl/pp: Include missing headers. 2009-09-24 10:56:46 +02:00
Michal Krol e1eed56702 glsl/pp: Allow builds on all platforms. 2009-09-24 10:56:01 +02:00
Michal Krol e8e3fe15e1 glsl/apps: Include missing header, properly escape format strings. 2009-09-24 10:55:37 +02:00
Michal Krol db097a9a3f glsl/apps: Allow builds on all platforms. 2009-09-24 10:54:56 +02:00
Michal Krol a58360dbc2 glsl/pp: Use struct instead of union. 2009-09-24 09:04:15 +02:00
Michal Krol 13f9a39cea glsl/apps: Fix apps after pp interface changes. 2009-09-24 08:43:54 +02:00
Michal Krol 9a1447d449 glsl/pp: Store both line number and file index in a single token. 2009-09-24 08:43:05 +02:00
Michal Krol 1ed1dc8b41 glsl/pp: Include missing headers. 2009-09-23 09:40:24 +02:00
Michal Krol 2f89e1a5a1 glsl/pp: Add `0' and `1' to dictionary. 2009-09-23 09:37:37 +02:00
Michal Krol 32966991c6 glsl/pp: Check for reserved macro names. 2009-09-23 09:33:12 +02:00
Michal Krol 125691dda3 glsl/apps: Update after recent pp interface changes. 2009-09-22 12:52:21 +02:00
Michal Krol 0481e85af7 glsl/pp: Differentiate between integer and floating-point number tokens. 2009-09-22 12:51:08 +02:00
Michal Krol 5f9f30a752 glsl/apps: Use glsl pp public interface. 2009-09-18 11:20:42 +02:00
Michal Krol 95956bb8cb glsl/pp: Define a public interface for external modules.
Make sl_pp_context struct opaque.
Move all public declarations to sl_pp_public.h.
2009-09-18 11:19:25 +02:00
Michal Krol 90daefd1c4 glsl/pp: Add a TODO for FEATURE_es2_glsl. 2009-09-17 12:33:26 +02:00
Michal Krol 4fcda5000e slang/pp: Fix file number parsing. 2009-09-17 12:14:12 +02:00
Michal Krol ce8f486156 slang/pp: Use a dictionary for the remaining string literals. 2009-09-17 12:12:34 +02:00
Michal Krol 0ddf41d34d glsl/pp: Add remaining error messages. 2009-09-17 11:51:35 +02:00
Michal Krol 69bdd47dba glsl/apps: Always write out error condition. 2009-09-17 10:45:16 +02:00
Michal Krol cc629940d4 glsl/apps: Always write out error condition. 2009-09-16 22:04:22 +02:00
Michal Krol a7382628f2 glsl/pp: Validate numbers. 2009-09-16 21:51:12 +02:00
Michal Krol de0753e4cb glsl/pp: Add more error messages. 2009-09-16 20:40:02 +02:00
Michal Krol d4638f5dce glsl/pp: Add more error messages. 2009-09-16 20:27:59 +02:00
Michal Krol 0f302b60fd glsl/pp: Support GL_ARB_draw_buffers and GL_ARB_texture_rectangle. 2009-09-14 13:09:36 +02:00
Michal Krol 169aead1b5 glsl/apps: Adapt to pp interface change. 2009-09-14 13:08:07 +02:00
Michal Krol a67f32289a glsl/pp: Add a dictionary to a context. 2009-09-14 13:07:25 +02:00
Michal Krol 5ad8937752 glsl: Add error messages for version parser. 2009-09-07 10:12:12 +02:00
Michal Krol b7960b3d3a glsl: Handle file tokens in apps/process. 2009-09-07 10:12:11 +02:00
Michal Krol a64ba93aab glsl: Handle file numbering. 2009-09-07 10:12:10 +02:00
Michal Krol 2d2d638444 glsl: Actually respect the hash-line directive. 2009-09-07 10:12:09 +02:00
Michal Krol b6df77fb9a glsl: Handle line tokens in apps/process. 2009-09-07 10:12:08 +02:00
Michal Krol 4aa3222df3 glsl: Correctly handle line numbering. 2009-09-07 10:12:07 +02:00
Michal Krol 0d9c5eafeb glsl: Preserve newline inside comment blocks. 2009-09-07 10:12:06 +02:00
Michal Krol e8afc65589 glsl: Implement predefinded macros.
The values are hardcoded: __LINE__ = 1, __FILE__ = 0 and __VERSION__ = 110.
2009-09-07 10:12:05 +02:00
Michal Krol bb8f38ea6f glsl: Implement `line' preprocessor directive. 2009-09-07 10:12:03 +02:00
Michal Krol ddd8ae7fbc glsl: Output endof token after processing a directive.
Some directives may output tokens as a result of their operation.
2009-09-07 10:12:03 +02:00
Michal Krol 7f187583c1 glsl: Handle extension tokens in apps/proces. 2009-09-07 10:12:02 +02:00
Michal Krol 87d2de04fb glsl: Implement `extension' preprocessor directive.
No extensions supported.
2009-09-07 10:12:00 +02:00
Michal Krol 94321b4441 glsl: Handle pragma tokens in apps/process. 2009-09-07 10:11:59 +02:00
Michal Krol 0e046420e4 glsl: Implement `pragma' preprocessor directive.
Handle `optimize(on|off)' and `debug(on|off)' pragmas.
2009-09-07 10:11:58 +02:00
Michal Krol c42428c787 glsl: Print out error message in apps/process. 2009-09-07 10:11:56 +02:00
Michal Krol f9bd6f7152 glsl: Implement `error' preprocessor directive. 2009-09-07 10:11:55 +02:00
Michal Krol 3dc2b5f71c glsl: Implement `undef' preprocessor directive. 2009-09-07 10:11:54 +02:00
Michal Krol a294715612 glsl: Allow for preprocessor macro redefinition. 2009-09-07 10:11:52 +02:00
Michal Krol 153b179862 glsl: Handle `defined' preprocessor operator. 2009-09-07 10:11:51 +02:00
Michal Krol 3b027bca9d glsl: Support if preprocessor directive and friends. 2009-09-07 10:11:50 +02:00
Michal Krol 3bb446ba6e glsl: Add expression interpreter. 2009-09-07 10:11:49 +02:00
Michal Krol 2dad8ed9d6 glsl: Centralise sl_pp_macro constructor. 2009-09-07 10:11:48 +02:00
Michal Krol 6a11d4150c glsl: Implement macro expansion. 2009-09-07 10:11:47 +02:00
Michal Krol 5e8e3cddae glsl: Rename sl_pp_context_add_str to sl_pp_context_add_unique_str.
Return the same offset for same strings. Allows to compare strings
by comparing their's offsets.
2009-09-07 10:11:46 +02:00
Michal Krol fd991d845a glsl: Parse define directive in preprocessor. 2009-09-07 10:11:45 +02:00
Michal Krol 3ce5e66818 glsl: Simplify directive parser skeleton. 2009-09-07 10:11:44 +02:00
Michal Krol f24322fbf6 glsl: Introduce sl_pp_context and maintain a reuseable pool of strings. 2009-09-07 10:11:43 +02:00
Michal Krol f24ec185c5 glsl: Add `process' test app that returns tokenised and preprocessed text. 2009-09-07 10:11:42 +02:00
Michal Krol 9d336c5264 glsl: Add preprocessor skeleton for directive parsing. 2009-09-07 10:11:40 +02:00
Michal Krol 5d26deef98 glsl: Remove bogus sl_pp_directive.h include. 2009-09-07 10:11:39 +02:00
Michal Krol b4e92367f3 glsl: Allow for multiple version statements. 2009-09-07 10:11:38 +02:00
Michal Krol 55f75c13f0 glsl/apps: Print out the number of tokens eaten in version test. 2009-09-07 10:11:38 +02:00
Michal Krol 474f754282 glsl: Raise an error on an unfinished comment block. 2009-09-07 10:11:37 +02:00
Michal Krol af617c6037 glsl/apps: Add version test app. 2009-09-07 10:11:36 +02:00
Michal Krol 229e72956c glsl: Parse optional version directive. 2009-09-07 10:11:33 +02:00
Michal Krol 0d5ef796f8 glsl: Add a tokenise app. 2009-09-07 10:11:32 +02:00
Michal Krol 2c9a627b48 glsl: Add a preprocessor tokeniser. 2009-09-07 10:11:31 +02:00
Michal Krol 121769eeb3 glsl: Add a purify command-line tool. 2009-09-07 10:11:30 +02:00
Michal Krol 0bbf59c305 glsl: Add preprocessor purifier. 2009-09-07 10:11:29 +02:00