History log of /external/mesa3d/src/glsl/ir_print_visitor.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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_print_visitor.cpp
807e967c615dc80a264af5a89af7649f95481744 23-Sep-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Use ir_rvalue to represent generic error_type values.

Currently, ir_call can be used as either a statement (for void
functions) or a value (for non-void functions). This is rather awkward,
as it's the only class that can be used in both forms.

A number of places use ir_call::get_error_instruction() to construct a
generic value of error_type. If ir_call is to become a statement, it
can no longer serve this purpose.

Unfortunately, none of our classes are particularly well suited for
this, and creating a new one would be rather aggrandizing. So, this
patch introduces ir_rvalue::error_value(), a static method that creates
an instance of the base class, ir_rvalue. This has the nice property
that you can't accidentally try and access uninitialized fields (as it
doesn't have any). The downside is that the base class is no longer
abstract.

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_print_visitor.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_print_visitor.cpp
bbbb8345ab9df2d634dc2a34d257ee2cbf930292 11-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> ir_to_mesa: Move some things outside the 'extern "C"' blocks

Having a few of these includes or forward declarations inside the
'extern "C"' block can cause problems later. Specifically, it
prevents C++ linkage functions from being added to ir_to_mesa.h and
makes G++ angry if 'struct foo' is seen both inside and outside an
'extern "C"'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/ir_print_visitor.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_print_visitor.cpp
174cef7fee7d400fc89a3ce68b7791d2aa3eb90f 25-Jun-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Don't choke when printing an anonymous function parameter

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/ir_print_visitor.cpp
6491e9593d5cbc5644eb02593a2f562447efdcbb 03-Jun-2011 Paul Berry <stereotype441@gmail.com> glsl: fixed printing of structure constants.

ir_print_visitor::visit(ir_constant *) was failing to index properly
into ir->type->fields.structure, so the first field name was being
reprinted for every field in the structure.

Signed-off-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/glsl/ir_print_visitor.cpp
56ef62d9885f805bbfb2243dc860ff425d5b4d3b 25-Mar-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Generate readable unique names at print time.

Since GLSL IR allows multiple ir_variables to share the same name, we
need to generate unique names when printing the IR. Previously, we
always used %s@%p, appending the ir_variable's memory address.

While this worked, it had two drawbacks:
- When there aren't duplicates, the extra "@0x669a3e88" is useless
and makes the code harder to read.
- Real duplicates were hard to tell apart:
channel_expressions@0x6699e3c8 vs. channel_expressions@0x6699ddd8

We now append @2, @3, @4, and so on, but only where necessary to
distinguish duplicates. Since we only do this at print time, any
performance impact is irrelevant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
/external/mesa3d/src/glsl/ir_print_visitor.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_print_visitor.cpp
497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f 10-Feb-2011 Ian Romanick <ian.d.romanick@intel.com> Use C-style system headers in C++ code to avoid issues with std:: namespace
/external/mesa3d/src/glsl/ir_print_visitor.cpp
61c59234f916406512b3591f46599cc29a5d8e23 04-Feb-2011 Vinson Lee <vlee@vmware.com> glsl: Add using statements for standard library functions.

Standard library functions in C++ are in the std namespace. When using
C++-style header files for the standard library, some compilers, such as
Sun Studio, provide symbols only for the std namespace and not for the
global namespace.

This patch adds using statements for standard library functions. Another
option could have been to prepend standard library function calls with
'std::'.

This patch fixes several compilation errors with Sun Studio.
/external/mesa3d/src/glsl/ir_print_visitor.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_print_visitor.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_print_visitor.cpp
60c8e91c795dc604c08977d5773f96a4de8e402b 31-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Re-synchronize ir_variable_mode and the printer's string array.

Since the introduction of ir_var_system_value, system variables would be
printed as "temporary" and temporaries would result in out-of-bounds
array access, showing up as garbage in printed IR.
/external/mesa3d/src/glsl/ir_print_visitor.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_print_visitor.cpp
b7acf538af24ddab72a5cbd5975f089a747b68e4 02-Dec-2010 Kenneth Graunke <kenneth@whitecape.org> ir_print_visitor: Print out constant structure values.

In the form (constant type ((field1 value) (field2 value) ...))
/external/mesa3d/src/glsl/ir_print_visitor.cpp
ff994eeff8fa9f8f889878d6b48015ca7683e22b 11-Nov-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Remove anti-built-in hacks from the print visitor.

Now that we only import built-in signatures that are actually used,
printing them is reasonable.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
fc92e87b9757eda01caf0bb3e2c31b1dbbd73aa0 11-Nov-2010 Ian Romanick <ian.d.romanick@intel.com> glsl: Eliminate assumptions about size of ir_expression::operands

This may grow in the near future.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
8fbe968a62f845da2a1491c398acf0b2140d2372 16-Sep-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Don't print blank (function ...) headers for built-ins.

Fixes a regression caused when I added my GLSL ES support.
/external/mesa3d/src/glsl/ir_print_visitor.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_print_visitor.cpp
9710d272f71c95c8145999a31e2c47e1977c698e 12-Aug-2010 Ian Romanick <ian.d.romanick@intel.com> ir_print_visitor: Print empty else blocks more compactly
/external/mesa3d/src/glsl/ir_print_visitor.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_print_visitor.cpp
d3b66be3c7a3e9e29913ea86880c516e2b7a3ce0 11-Aug-2010 Brian Paul <brianp@vmware.com> glsl2: added casts to silence warnings
/external/mesa3d/src/glsl/ir_print_visitor.cpp
5a7758efbe14dee026245a4f4f4fb3ccf7b2c23b 03-Aug-2010 Ian Romanick <ian.d.romanick@intel.com> glsl2: Add ir_assignment::write_mask and associated methods

Replace swizzles on the LHS with additional swizzles on the RHS and a
write mask in the assignment instruction. As part of this add
ir_assignment::set_lhs. Ideally we'd make ir_assignment::lhs private
to prevent erroneous writes, but that would require a lot of code
butchery at this point.

Add ir_assignment constructor that takes an explicit write mask. This
is required for ir_assignment::clone, but it can also be used in other
places. Without this, ir_assignment clones lose their write masks,
and incorrect IR is generated in optimization passes.

Add ir_assignment::whole_variable_written method. This method gets
the variable on the LHS if the whole variable is written or NULL
otherwise. This is different from
ir->lhs->whole_variable_referenced() because the latter has no
knowledge of the write mask stored in the ir_assignment.

Gut all code from ir_to_mesa that handled swizzles on the LHS of
assignments. There is probably some other refactoring that could be
done here, but that can be left for another day.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
0e1992255837c88ba3c6631d5282fe944703ba56 30-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: Allow use of _mesa_print_ir without a parse state on hand.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
bf496862be1ba863285aa2c1a2262b2d764c3e53 29-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: When dumping IR for debug, indent nested blocks.

No more trying to match parens in my head when looking at the body of
a short function containing an if statement.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
9a8eb684d4cd602b6c5e6876cd1eceabc3a8896c 29-Jul-2010 Eric Anholt <eric@anholt.net> glsl2: When dumping IR for debug, skip all the empty builtin prototypes.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
40c4298a6ea9e83b49858916d5423fd2135ef39c 23-Jul-2010 Kenneth Graunke <kenneth@whitecape.org> ir_print_visitor: Add "temporary" to mode string printing.

Variables with mode ir_var_temporary were causing an out of bounds array
access and filling my screen with rubbish. I'm not sure if "temporary"
is the right thing to print.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
9930d18c2aefad12152d12bc251d02ae1c1593bc 20-Jul-2010 Kenneth Graunke <kenneth@whitecape.org> ir_print_visitor: Print out constant arrays.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
7ea977a15c05f4a638478b7a5b8ca78454cecf41 20-Jul-2010 Kenneth Graunke <kenneth@whitecape.org> ir_print_visitor: Remove commas between ir_constant's components.

The IR reader does not expect commas.
/external/mesa3d/src/glsl/ir_print_visitor.cpp
16efab1c4dee6e6a827ba5f1c482378159545ae5 30-Jun-2010 Kenneth Graunke <kenneth@whitecape.org> glsl2: Define new ir_discard instruction.
/external/mesa3d/src/glsl/ir_print_visitor.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_print_visitor.cpp