Commit Graph

29 Commits

Author SHA1 Message Date
Kenneth Graunke
8331d48948 Don't call _mesa_glsl_initialize_types for every builtin function.
This was clearly wrong; types are now only initialized once.
2010-06-09 11:14:58 -07:00
Kenneth Graunke
56d3f6ad78 Set the type of ir_texture properly; infer it from the sampler type. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
dd5b4a544b ir_reader: Add support for reading ir_texture. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
3c7934bfaa ir_reader: Refactor reading of dereferences for later reuse. 2010-06-09 11:14:57 -07:00
Kenneth Graunke
13e1b6b725 ir_reader: Read record_refs.
Also changes the print visitor to not emit extraneous parenthesis.
2010-05-26 15:24:53 -07:00
Kenneth Graunke
350bd70348 ir_reader: Fix reading of array deferences and correct error messages.
Previously, the syntax was (array_ref <variable name> <index>), but the
subject is now a general rvalue (not a name).  In particular, it might
be a (var_ref ...).

Also, remove "expected ... or (swiz)" from error messages; swiz is not
allowed inside a var_ref.
2010-05-26 15:24:40 -07:00
Ian Romanick
70fe8b6663 Begin refactoring ir_dereference
Create separate subclasses of ir_dereference for variable, array, and
record dereferences.  As a side effect, array and record dereferences
no longer point to ir_variable objects directly.  Instead they each
point to an ir_dereference_variable object.

This is the first of several steps in the refactoring process.  The
intention is that ir_dereference will eventually become an abstract
base class.
2010-05-26 15:23:19 -07:00
Kenneth Graunke
f6c90d8b34 ir_reader: Set function signatures as defined. 2010-05-14 16:34:46 -07:00
Kenneth Graunke
bf783ecea6 ir_reader: Slightly better error message when failing to read swizzles. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
92eb64cd33 ir_reader: Don't print out the S-Expression.
It's no longer useful for debugging.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
b51557fbe2 ir_reader: Read function calls. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
b142aeeb20 ir_reader: Replace function prototypes with the definition.
Previously, we just created a new one, which was wrong.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
21128c23c6 ir_reader: Fix incorrect error message for expressions. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
46a223224c Make ir_read_error print out the given S-Expression, for context. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
951632253f ir_reader: Fix for swizzles. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
8df335d7f9 ir_reader: Preliminary work toward reading functions. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
09cad1339d ir_reader: Perform a preliminary pass to scan for function prototypes. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
ddf5a011e2 ir_reader: Don't initialize globals, builtins, or constructors.
All of these are currently emitted as part of the IR, so by initializing
them, we actually end up with two copies.  For constructors, we may
eventually wish to avoid emitting them as part of the IR output.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
4ec982fb86 Make ir_read_error set state->error. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
396fa9eba6 ir_reader: Add support for "break" and "continue" in loops.
Includes threading the ir_loop * context through various functions.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
32b305207c ir_reader: Add initial loop support; doesn't yet support break/continue. 2010-04-28 18:14:54 -07:00
Kenneth Graunke
451381c220 ir_reader: Add support for reading (var_ref ...) and (array_ref ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
46ef8f19d7 ir_reader: rvalues are instructions too! 2010-04-28 18:14:54 -07:00
Kenneth Graunke
3ea0582803 ir_reader: Add support for reading conditionals: (if ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
5794497542 ir_reader: Add support for reading array types.
Also, constify glsl_type pointers; this was necessary to use
glsl_type::get_array_instance.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
9d2ff7617a ir_reader: Add support for reading (return ...) 2010-04-28 18:14:54 -07:00
Kenneth Graunke
d1d2ada3c6 ir_reader: Add support for reading variable declarations.
It also now reads a list of instructions, as it should, rather than a
single rvalue.
2010-04-28 18:14:54 -07:00
Kenneth Graunke
f955649af3 Partial IR reader.
Currently reads assignments, constants, expressions, and swizzles.
2010-04-28 18:14:53 -07:00
Kenneth Graunke
34350be2cd Add stub ir_reader and new 'i' mode for reading IR rather than GLSL. 2010-04-28 18:14:53 -07:00