History log of /external/mesa3d/src/glsl/ir_reader.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
41b47441d720957d7b8a63afa26d94c752c8740b 18-Apr-2012 Eric Anholt <eric@anholt.net> glsl: Make ir_reader parse the "temporary" variable qualifier.

This lets ir_reader eat the output of builtin_compiler on actual
function definitions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/ir_reader.cpp
d884f60861f270cdcf7d9d47765efcf1e1de30b6 20-Mar-2012 Kenneth Graunke <kenneth@whitecape.org> glsl: Convert ir_call to be a statement rather than a value.

Aside from ir_call, our IR is cleanly split into two classes:
- Statements (typeless; used for side effects, control flow)
- Values (deeply nestable, pure, typed expression trees)

Unfortunately, ir_call confused all this:
- For void functions, we placed ir_call directly in the instruction
stream, treating it as an untyped statement. Yet, it was a subclass
of ir_rvalue, and no other ir_rvalue could be used in this way.
- For functions with a return value, ir_call could be placed in
arbitrary expression trees. While this fit naturally with the source
language, it meant that expressions might not be pure, making it
difficult to transform and optimize them. To combat this, we always
emitted ir_call directly in the RHS of an ir_assignment, only using
a temporary variable in expression trees. Many passes relied on this
assumption; the acos and atan built-ins violated it.

This patch makes ir_call a statement (ir_instruction) rather than a
value (ir_rvalue). Non-void calls now take a ir_dereference of a
variable, and store the return value there---effectively a call and
assignment rolled into one. They cannot be embedded in expressions.

All expression trees are now pure, without exception.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/ir_reader.cpp
622eed075092a0325e0927bf2f9ef29f20bbf416 22-Sep-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Split out ir_reader's ability to read ir_dereference_variables.

Most of the time, we just want to read an ir_dereference, so there's no
need to have these in separate functions. However, the next patch will
want to read an ir_dereference_variable directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/ir_reader.cpp
3b4d2eac6001b464df11b175bd14fd4d3c4e412f 25-Oct-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Remove pointless uses of glsl_type::get_base_type().

These are effectively doing type->get_base_type()->base_type, which is
equivalent to type->base_type. Just use that, as it's simpler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/ir_reader.cpp
cf45949d6a896651a5f3864d3b195e26d59eee74 26-Oct-2011 Paul Berry <stereotype441@gmail.com> mesa: Expose GLSL interpolation qualifiers in gl_fragment_program.

This patch makes GLSL interpolation qualifiers visible to drivers via
the array InterpQualifier[] in gl_fragment_program, so that they can
easily be used by driver back-ends to select the correct interpolation
mode.

Previous to this patch, the GLSL compiler was using the enum
ir_variable_interpolation to represent interpolation types. Rather
than make a duplicate enum in core mesa to represent the same thing, I
moved the enum into mtypes.h and renamed it to be more consistent with
the other enums defined there.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/ir_reader.cpp
0d949a51bb44da51cd843abcf6ecddc5e3d3a2f1 22-Sep-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Free all S-Expressions immediately after reading IR.

For some reason I thought subexpressions were chained off the top-level
one. This isn't the case, so just create a temporary context and free
it. All of this memory would be eventually freed, but now is freed
much sooner.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/ir_reader.cpp
c0470bf77a038fd45441d1e55e6c89100996ff4b 07-Sep-2011 Brian Paul <brianp@vmware.com> glsl: s/int/unsigned/ to silence warning
/external/mesa3d/src/glsl/ir_reader.cpp
8ceb235c9cbb9504e32479db54287ed9387df75a 05-Sep-2011 Kenneth Graunke <kenneth@whitecape.org> glsl/ir_reader: Make sure constants have the right number of components.

The list of numbers in (constant type (<numbers>)) needs to contain
exactly type->components() numbers (16 for a mat4, 3 for a vec3, etc.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/ir_reader.cpp
1e3bcbdf31f09666ba358f35ff9486faee3642ca 25-Feb-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Add a new ir_txs (textureSize) opcode to ir_texture.

One unique aspect of TXS is that it doesn't have a coordinate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/glsl/ir_reader.cpp
f4830be938c8fa33086f73cab19a53ab3e14cb9c 30-Jun-2011 Paul Berry <stereotype441@gmail.com> glsl: Make ir_reader able to read plain (return) statements.

Previously ir_reader was only able to handle return of non-void.

This patch is necessary in order to allow optimization passes to be
tested in isolation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/ir_reader.cpp
233b88eab9d8095523ebae3c4be1dbf2e2bd856a 25-Feb-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Explicitly specify a type when reading/printing ir_texture.

This is necessary for GLSL 1.30+ shadow sampling functions, which return
a single float rather than splatting the value to a vec4 based on
GL_DEPTH_TEXTURE_MODE.
/external/mesa3d/src/glsl/ir_reader.cpp
819d57fce94b20fa0d34da6f037f0a53c4a5bdc2 13-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Introduce a new "const_in" variable mode.

This annotation is for an "in" function parameter for which it is only legal
to pass constant expressions. The only known example of this, currently,
is the textureOffset functions.

This should never be used for globals.
/external/mesa3d/src/glsl/ir_reader.cpp
c5a27b5939427bdc95c926b450ed3de1ff4baafb 09-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Change texel offsets to a single vector rvalue.

Having these as actual integer values makes it difficult to implement
the texture*Offset built-in functions, since the offset is actually a
function parameter (which doesn't have a constant value).

The original rationale was that some hardware needs these offset baked
into the instruction opcode. However, at least i965 should be able to
support non-constant offsets. Others should be able to rely on inlining
and constant propagation.
/external/mesa3d/src/glsl/ir_reader.cpp
d3073f58c17d8675a2ecdd5dfa83e5520c78e1a8 21-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> Convert everything from the talloc API to the ralloc API.
/external/mesa3d/src/glsl/ir_reader.cpp
9f2bf3d65cf0745a34185c1966d52389fbd1ca90 25-Jan-2011 Brian Paul <brianp@vmware.com> glsl: silence uninitialized var warning in read_texture()

And generate an error if the texture pattern is not matched.
/external/mesa3d/src/glsl/ir_reader.cpp
e256e4743c3f8f924f0d191759d9428f33f3e329 19-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl, i965: Remove unnecessary talloc includes.

These are already picked up by ir.h or glsl_types.h.
/external/mesa3d/src/glsl/ir_reader.cpp
bbafd2b849629d3155fe0eef655bbc166a901925 01-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Make assignment conditions optional.

You can now simply write (assign (xy) <lhs> <rhs>) instead of the
verbose (assign (constant bool (1)) (xy) <lhs> <rhs>).
/external/mesa3d/src/glsl/ir_reader.cpp
b74ff382a42bcb81bbf0dc6a85bb38404c46260d 01-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Convert to a class.

This makes it unnecessary to pass _mesa_glsl_parse_state around
everywhere, making at least the prototypes a lot easier to read.

It's also more C++-ish than a pile of static C functions.
/external/mesa3d/src/glsl/ir_reader.cpp
ec7e4f0ec5c9b718bbfa33a706149030be86d2d9 31-Dec-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Combine the three dereference reading functions into one.

These used to be more complicated, but now are so simple there's no real
point in keeping them separate.
/external/mesa3d/src/glsl/ir_reader.cpp
e486fca2d3b430065cbcb27c5d1b545642e11ab5 31-Dec-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Relax requirement that function arguments be s_lists.

All of these functions used to take s_list pointers so they wouldn't all
need SX_AS_LIST conversions and error checking. However, the new
pattern matcher conveniently does this for us in one centralized place.

So there's no need to insist on s_list. Switching to s_expression saves
a bit of code and is somewhat cleaner.
/external/mesa3d/src/glsl/ir_reader.cpp
d7988152722cd5f3930064a139b567cbcb0e5f53 31-Dec-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Remove s_list::length() method.

Most code now relies on the pattern matcher rather than this function,
and for the only remaining case, not using this saves an iteration.
/external/mesa3d/src/glsl/ir_reader.cpp
daeb0c646e0d652bfa16d326028753ecf092c0c9 03-Nov-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Add a pattern matching system and use it everywhere.

Previously, the IR reader was riddled with code that:
1. Checked for the right number of list elements (via a linked list walk)
2. Retrieved references to each component (via ->next->next pointers)
3. Downcasted as necessary to make sure that each sub-component was the
right type (i.e. symbol, int, list).
4. Checking that the tag (i.e. "declare") was correct.

This was all very ad-hoc and a bit ugly. Error checking had to be done
at both steps 1, 3, and 4. Most code didn't even check the tag, relying
on the caller to do so. Not all callers did.

The new pattern matching module performs the whole process in a single
straightforward function call, resulting in shorter, more readable code.

Unfortunately, MSVC does not support C99-style anonymous arrays, so the
pattern must be declared outside of the match call.
/external/mesa3d/src/glsl/ir_reader.cpp
001eee52d461233b1e1d6ed3577965e9bcb209e8 05-Nov-2010 Eric Anholt <eric@anholt.net> glsl: Make the symbol table's add_variable just use the variable's name.
/external/mesa3d/src/glsl/ir_reader.cpp
e8f5ebf313da3ce33ccbbcf9b72946853035fbdd 05-Nov-2010 Eric Anholt <eric@anholt.net> glsl: Make the symbol table's add_function just use the function's name.
/external/mesa3d/src/glsl/ir_reader.cpp
c180e95d267c302c40e1cb92e5b134b4e370ef2e 03-Nov-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Fix some potential NULL pointer dereferences.

Found by inspection.
/external/mesa3d/src/glsl/ir_reader.cpp
e751ce39bfbc5be35005cedcd3d98cf820f68cde 03-Nov-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Remove useless error check.

It's already been determined that length == 3, so clearly swiz->next is
a valid S-Expression.
/external/mesa3d/src/glsl/ir_reader.cpp
0fd665ca63ba37b9a3022f21a8d9f363530e2038 31-Oct-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Return a specific ir_dereference variant.

There's really no reason to return the base class when we have more
specific information about what type it is.
/external/mesa3d/src/glsl/ir_reader.cpp
f412fac5b46eb274cbed8e62234d5dbfd859f1fe 05-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Move is_builtin flag back to ir_function_signature.

This effectively reverts b6f15869b324ae64a00d0fe46fa3c8c62c1edb6c.

In desktop GLSL, defining a function with the same name as a built-in
hides that built-in function completely, so there would never be
built-in and user function signatures in the same ir_function.

However, in GLSL ES, overloading built-ins is allowed, and does not
hide the built-in signatures - so we're back to needing this.
/external/mesa3d/src/glsl/ir_reader.cpp
9a3df46fbcfbad10163686ae4c034a3a55116947 05-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Only validate IR when a global 'debug' flag is set.

This extra validation is very useful when working on the built-ins, but
in general overkill - the results should stay the same unless the
built-ins or ir_validate have changed.

Also, validating all the built-in functions in every test case makes
piglit run unacceptably slow.
/external/mesa3d/src/glsl/ir_reader.cpp
79088746a231d361232fc87ab4d578b08c7ce2a7 04-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Run ir_validate on the generated IR.

It's just too easy to get something wrong in hand-written IR.
/external/mesa3d/src/glsl/ir_reader.cpp
2809d707231fba0e91abe1dd32e9f2d3284b9d3a 04-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Emit global variables at the top of the instruction list.

Since functions are emitted when scanning for prototypes, functions
always come first, even if the original IR listed the variable
declarations first.

Fixes an ir_validate error (to be turned on in the next commit).
/external/mesa3d/src/glsl/ir_reader.cpp
b758de16e3e6e27e9ead24aa6241b5d4db0d8836 04-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Drop support for reading the old assignment format.
/external/mesa3d/src/glsl/ir_reader.cpp
03a6276477702404f5c7a4f5f2fbb713371c7eed 03-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Read the new assignment format (with write mask).

This preserves the ability to read the old format, for momentary
compatibility with all the existing IR implementations of built-ins.
/external/mesa3d/src/glsl/ir_reader.cpp
a71b46a8ad344a86de2b13fe0c283ac2036c5f76 04-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Track the current function and report it in error messages.
/external/mesa3d/src/glsl/ir_reader.cpp
b43611b79c1f0a5caff80c17c9e7840a718f07c9 29-Aug-2010 Vinson Lee <vlee@vmware.com> glsl: Initialize data in read_constant.

Completely initialize data that is passed into a ir_constant constructor.

Fixes piglit glsl-fs-mix valgrind uninitialized variable error on
softpipe and llvmpipe.
/external/mesa3d/src/glsl/ir_reader.cpp
b6f15869b324ae64a00d0fe46fa3c8c62c1edb6c 21-Aug-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Move is_built_in flag from ir_function_signature to ir_function.

Also rename it to "is_builtin" for consistency.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/ir_reader.cpp
43ff8f1a4b90554eae489cebb7e05f983dd9ad66 12-Aug-2010 Kenneth Graunke <kenneth@whitecape.org> glsl2: Rework builtin function generation.

Each language version/extension and target now has a "profile" containing
all of the available builtin function prototypes. These are written in
GLSL, and come directly out of the GLSL spec (except for expanding genType).

A new builtins/ir/ folder contains the hand-written IR for each builtin,
regardless of what version includes it. Only those definitions that have
prototypes in the profile will be included.

The autogenerated IR for texture builtins is no longer written to disk,
so there's no longer any confusion as to what's hand-written or
generated.

All scripts are now in python instead of perl.
/external/mesa3d/src/glsl/ir_reader.cpp
d802ba110f78c3eee9541867cde819ada1b2c449 12-Aug-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Don't mark functions as defined if their body is empty.
/external/mesa3d/src/glsl/ir_reader.cpp
3c033637de7def553559c11d037f2e8bbb750f77 23-Jul-2010 Kenneth Graunke <kenneth@whitecape.org> glsl2: Make ir_assignment derive from ir_instruction, not ir_rvalue.

Assignments can only exist at the top level instruction stream; the
residual value is handled by assigning the value to a temporary and
returning an ir_dereference_variable of that temporary.
/external/mesa3d/src/glsl/ir_reader.cpp
ef2c38b2450eb366a2e6f6a46d1725aa6c14d74b 20-Jul-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Add support for reading constant arrays.
/external/mesa3d/src/glsl/ir_reader.cpp
f38d15b80d4e4c8ecb7a76087cdc49835f0aa271 21-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> glsl2: glsl_type has its own talloc context, don't pass one in
/external/mesa3d/src/glsl/ir_reader.cpp
7e2aa91507a5883e33473e0a94215ee3985baad1 20-Jul-2010 Ian Romanick <ian.d.romanick@intel.com> glsl2: Add and use new variable mode ir_var_temporary

This is quite a large patch because breaking it into smaller pieces
would result in the tree being intermitently broken. The big changes
are:

* Add the ir_var_temporary variable mode

* Change the ir_variable constructor to take the mode as a
parameter and correctly specify the mode for all ir_varables.

* Change the linker to not cross validate ir_var_temporary
variables.

* Change the linker to pull all ir_var_temporary variables from
global scope into 'main'.
/external/mesa3d/src/glsl/ir_reader.cpp
1f47245bdda2c85bf0f0174e6c24a50486b413aa 19-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Remove the const disease from function signature's callee.
/external/mesa3d/src/glsl/ir_reader.cpp
13f782c4ae4e38e64ec4fe87a1c24597a5e894c3 30-Jun-2010 Ian Romanick <ian.d.romanick@intel.com> linker: Implement first bits of intrastage linking

This currently involves an ugly hack so that every link doesn't result
in all the built-in functions showing up as multiply defined. As soon
as the built-in functions are stored in a separate compilation unit,
ir_function_signature::is_built_in can be removed.
/external/mesa3d/src/glsl/ir_reader.cpp
e024c5c6900c068634c2726d9ccfb9beac966c57 08-Jul-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Don't emit ir_function multiple times.
/external/mesa3d/src/glsl/ir_reader.cpp
2070f9f5bec99e7b91309060984431aa7ea32c00 03-Jul-2010 Kenneth Graunke <kenneth@whitecape.org> glsl2: Fix for dead strings being stored in the symbol table.
/external/mesa3d/src/glsl/ir_reader.cpp
953ff1283d3d52e6a6b4850c2b0b574111625010 25-Jun-2010 Kenneth Graunke <kenneth@whitecape.org> 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.
/external/mesa3d/src/glsl/ir_reader.cpp
78062273de65bf8133f2550aa2a26040a82a65aa 25-Jun-2010 Kenneth Graunke <kenneth@whitecape.org> 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.
/external/mesa3d/src/glsl/ir_reader.cpp
29285882676388aacff123e8bdf025904abf8ea9 25-Jun-2010 Eric Anholt <eric@anholt.net> glsl2: Move the compiler to the subdirectory it will live in in Mesa.
/external/mesa3d/src/glsl/ir_reader.cpp