profile/ivi/mesa.git
14 years agoSet the type of ir_texture properly; infer it from the sampler type.
Kenneth Graunke [Thu, 3 Jun 2010 22:07:34 +0000 (15:07 -0700)]
Set the type of ir_texture properly; infer it from the sampler type.

14 years agoir_reader: Add support for reading ir_texture.
Kenneth Graunke [Thu, 27 May 2010 00:55:10 +0000 (17:55 -0700)]
ir_reader: Add support for reading ir_texture.

14 years agoir_reader: Refactor reading of dereferences for later reuse.
Kenneth Graunke [Thu, 27 May 2010 00:52:44 +0000 (17:52 -0700)]
ir_reader: Refactor reading of dereferences for later reuse.

14 years agoAdd stub visitor support for ir_texture.
Kenneth Graunke [Thu, 27 May 2010 00:42:03 +0000 (17:42 -0700)]
Add stub visitor support for ir_texture.

14 years agoir_print_visitor: Add support for ir_texture.
Kenneth Graunke [Wed, 26 May 2010 22:15:31 +0000 (15:15 -0700)]
ir_print_visitor: Add support for ir_texture.

14 years agoAdd mappings between ir_texture_opcode and strings.
Kenneth Graunke [Wed, 26 May 2010 23:41:47 +0000 (16:41 -0700)]
Add mappings between ir_texture_opcode and strings.

14 years agoDefine IR instruction for texture look-ups
Ian Romanick [Thu, 29 Apr 2010 01:42:36 +0000 (18:42 -0700)]
Define IR instruction for texture look-ups

14 years agoUse array delete operator to delete an array
Ian Romanick [Wed, 9 Jun 2010 18:00:00 +0000 (11:00 -0700)]
Use array delete operator to delete an array

This was detected by valgrind.  I think GCC still does the right
thing, but the C++ spec allows the compiler to do something
stupid... like crash or only delete the first entry in the array.

14 years agoBump GL_MAX_TEXTURE_COORDS from 2 to 4
Ian Romanick [Tue, 8 Jun 2010 02:10:33 +0000 (19:10 -0700)]
Bump GL_MAX_TEXTURE_COORDS from 2 to 4

Every platform that supports GLSL sets GL_MAX_TEXTURE_COORDS to at
least 4, so hard-code 4 for now.

This causes the following tests to pass:

    glslparsertest/glsl2/norsetto-bumptbn_sh_fp.vert
    glslparsertest/glsl2/xreal-lighting-d-omni.vert
    glslparsertest/glsl2/xreal-lighting-db-omni.vert
    glslparsertest/glsl2/xreal-lighting-dbs-omni.vert

14 years agoOnly allow global precision qualifier for int and float
Ian Romanick [Tue, 8 Jun 2010 02:02:44 +0000 (19:02 -0700)]
Only allow global precision qualifier for int and float

This causes the following tests to pass:

    glslparsertest/glsl2/precision-03.vert

14 years agoFix parsing of precision qualifiers
Ian Romanick [Tue, 8 Jun 2010 01:55:41 +0000 (18:55 -0700)]
Fix parsing of precision qualifiers

This causes the following tests to pass:

     glslparsertest/glsl2/precision-02.vert
     glslparsertest/glsl2/precision-04.vert
     glslparsertest/glsl2/precision-06.vert

This causes the following test to fail.  This shader was previously
failing to compile, but it was failing for the wrong reasons.

     glslparsertest/glsl2/precision-03.vert

14 years agoDon't process empty shaders
Ian Romanick [Tue, 8 Jun 2010 01:53:06 +0000 (18:53 -0700)]
Don't process empty shaders

Some valid shaders, such as 'precision highp float;', evaluate to
empty sets of instructions.  This causes some of the optimization
stages to enter infinite loops.  Instead, don't bother processing the
empty ones.

14 years agoGenerate an error on empty declaration lists
Ian Romanick [Tue, 8 Jun 2010 01:49:48 +0000 (18:49 -0700)]
Generate an error on empty declaration lists

This causes an error for code such as 'float;'

14 years agoCheck variable mode when comparing qualifier lists.
Kenneth Graunke [Fri, 4 Jun 2010 19:56:15 +0000 (12:56 -0700)]
Check variable mode when comparing qualifier lists.

Fixes function-05.vert.

14 years agoir_dereference_array always operates on an r-value
Ian Romanick [Wed, 2 Jun 2010 20:50:27 +0000 (13:50 -0700)]
ir_dereference_array always operates on an r-value

ir_dereference_array::array is always an r-value.  If the dereference
is of a varaible, that r-value will be an ir_dereference_variable.
This simplifies the code a bit.

14 years agoThere is no class ir_label, so there's no need for ir_instruction::as_label
Ian Romanick [Wed, 2 Jun 2010 20:39:45 +0000 (13:39 -0700)]
There is no class ir_label, so there's no need for ir_instruction::as_label

14 years agoRemove some cruft from the Makefile
Ian Romanick [Wed, 2 Jun 2010 20:13:40 +0000 (13:13 -0700)]
Remove some cruft from the Makefile

This was affecting the build, but the files don't actually exist.

14 years agoAdd builtin gl_LightSource[].
Eric Anholt [Wed, 19 May 2010 21:09:04 +0000 (14:09 -0700)]
Add builtin gl_LightSource[].

Fixes gst-gl-bumper.vert parsing.

14 years agobuiltins: Add support for reflect().
Eric Anholt [Wed, 19 May 2010 21:01:33 +0000 (14:01 -0700)]
builtins: Add support for reflect().

Fixes glsl-orangebook-ch06.frag parsing.

14 years agobuiltins: Add ftransform().
Eric Anholt [Wed, 19 May 2010 20:57:01 +0000 (13:57 -0700)]
builtins: Add ftransform().

Fixes glsl-orangebook-ch06-bump.vert.

14 years agoAllow arrays of floats as varyings.
Eric Anholt [Wed, 19 May 2010 20:38:15 +0000 (13:38 -0700)]
Allow arrays of floats as varyings.

The comment just above the code said arrays were OK, then it didn't
handle arrays.  Whoops.  Partially fixes CorrectUnsizedArray.frat.

14 years agogl_Normal is a vec3 not a vec4.
Eric Anholt [Wed, 19 May 2010 20:30:14 +0000 (13:30 -0700)]
gl_Normal is a vec3 not a vec4.

Fixes CorrectSwizzle1.vert.

14 years agobuiltins: Add the mix(gentype, gentype, float) variant.
Eric Anholt [Wed, 19 May 2010 20:05:01 +0000 (13:05 -0700)]
builtins: Add the mix(gentype, gentype, float) variant.

The broken-in-mesa Regnum Online shader now parses, except for its
preprocessor usage.

14 years agoHandle GLSL 1.20 implicit type conversions.
Eric Anholt [Wed, 19 May 2010 17:38:37 +0000 (10:38 -0700)]
Handle GLSL 1.20 implicit type conversions.

We were nicely constructing a new expression for the implicit type
conversion, but then checking that the previous types matched instead
of the new expression's type.  Fixes errors in Regnum Online shaders.

14 years agobuiltins: Add atan().
Eric Anholt [Wed, 19 May 2010 19:44:23 +0000 (12:44 -0700)]
builtins: Add atan().

14 years agobuiltins: Add asin().
Eric Anholt [Wed, 19 May 2010 19:19:54 +0000 (12:19 -0700)]
builtins: Add asin().

14 years agoir_constant_expression: Handle several floating point unops.
Eric Anholt [Wed, 12 May 2010 21:42:21 +0000 (14:42 -0700)]
ir_constant_expression: Handle several floating point unops.

Cleans up a bunch of pointless operations in a GStreamer fragment shader.

14 years agoir_constant_variable: New pass to mark constant-assigned variables constant.
Eric Anholt [Wed, 12 May 2010 19:10:41 +0000 (12:10 -0700)]
ir_constant_variable: New pass to mark constant-assigned variables constant.

This removes a bunch of gratuitous moving around of constant values
from constructors.  Makes a shader ir I was looking at for structure
handling almost readable.

14 years agoir_constant_folding: Look at instructions in functions.
Eric Anholt [Wed, 12 May 2010 19:15:40 +0000 (12:15 -0700)]
ir_constant_folding: Look at instructions in functions.

This was broken in the ir_label -> ir_function rework.

14 years agoir_swizzle_swizzle: Reduce swizzle chains to a single swizzle.
Eric Anholt [Tue, 11 May 2010 19:34:21 +0000 (12:34 -0700)]
ir_swizzle_swizzle: Reduce swizzle chains to a single swizzle.

14 years agoir_vec_index_to_swizzle: Pass to convert indexing of vectors to swizzles.
Eric Anholt [Tue, 11 May 2010 18:31:09 +0000 (11:31 -0700)]
ir_vec_index_to_swizzle: Pass to convert indexing of vectors to swizzles.

This should remove the burden of handling constant vector indexing
well from backend codegen, and could help with swizzle optimizations.

14 years agoir_expression_flattening: Handle flattening values out of swizzles, too.
Eric Anholt [Thu, 6 May 2010 21:48:20 +0000 (14:48 -0700)]
ir_expression_flattening: Handle flattening values out of swizzles, too.

Fixes an uninlined normalize() in CorrectSwizzle2.vert.

14 years agoir_expression_flattening: Fix breakage from hierarchichal visitor.
Eric Anholt [Tue, 1 Jun 2010 22:06:11 +0000 (15:06 -0700)]
ir_expression_flattening: Fix breakage from hierarchichal visitor.

Similar to other situations where the visitor pattern doesn't fit, in
this case we need the pointer to the base instruction in the
instruction stream for where to insert any new instructions we
generate (not the instruction in the tree we're looking at).  By
removing the code for setting the base_ir, flattened expressions would
end up, for example, before the function definition where they had appeared.

14 years agoReimplement ir_function_inlining_visitor using ir_hierarchical_vistor
Ian Romanick [Thu, 27 May 2010 01:58:27 +0000 (18:58 -0700)]
Reimplement ir_function_inlining_visitor using ir_hierarchical_vistor

14 years agoReimplement ir_copy_propagation_visitor using ir_hierarchical_vistor
Ian Romanick [Thu, 27 May 2010 00:04:19 +0000 (17:04 -0700)]
Reimplement ir_copy_propagation_visitor using ir_hierarchical_vistor

14 years agoReimplement ir_expression_flattening_visitor using ir_hierarchical_vistor
Ian Romanick [Wed, 26 May 2010 23:07:49 +0000 (16:07 -0700)]
Reimplement ir_expression_flattening_visitor using ir_hierarchical_vistor

14 years agoir_reader: Read record_refs.
Kenneth Graunke [Wed, 26 May 2010 22:20:59 +0000 (15:20 -0700)]
ir_reader: Read record_refs.

Also changes the print visitor to not emit extraneous parenthesis.

14 years agoir_reader: Fix reading of array deferences and correct error messages.
Kenneth Graunke [Wed, 26 May 2010 20:03:14 +0000 (13:03 -0700)]
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.

14 years agoFix setting the maximum accessed array element
Ian Romanick [Wed, 26 May 2010 22:08:11 +0000 (15:08 -0700)]
Fix setting the maximum accessed array element

Array dereferences now point to variable dereferences instead of
pointing directly to variables.  This necessitated some changes to the
way the variable is accessed when setting the maximum index array element.

14 years agoir_dereference::mode is no longer used, kill with fire
Ian Romanick [Wed, 26 May 2010 18:43:40 +0000 (11:43 -0700)]
ir_dereference::mode is no longer used, kill with fire

14 years agoRefactor whole-variable assigment checking into member function
Ian Romanick [Wed, 26 May 2010 18:32:52 +0000 (11:32 -0700)]
Refactor whole-variable assigment checking into member function

14 years agoRefactor ir_dereference data fields to subclasses
Ian Romanick [Wed, 19 May 2010 11:52:29 +0000 (13:52 +0200)]
Refactor ir_dereference data fields to subclasses

14 years agoReplace open coded deref navigation with hierarchical visitors
Ian Romanick [Wed, 19 May 2010 11:47:39 +0000 (13:47 +0200)]
Replace open coded deref navigation with hierarchical visitors

14 years agoRefactor ir_dereference support for ir_visitor
Ian Romanick [Wed, 19 May 2010 11:20:12 +0000 (13:20 +0200)]
Refactor ir_dereference support for ir_visitor

Move the accept method for visitors from ir_dereference to the derived
classes.

14 years agoRefactor ir_dereference support for ir_hierarchical_visitor
Ian Romanick [Wed, 19 May 2010 10:02:19 +0000 (12:02 +0200)]
Refactor ir_dereference support for ir_hierarchical_visitor

Move the accept method for hierarchical visitors from ir_dereference
to the derived classes.  This was mostly straight-forward, but I
suspect that ir_dead_code_local may be broken now.

14 years agoBegin refactoring ir_dereference
Ian Romanick [Wed, 19 May 2010 09:37:35 +0000 (11:37 +0200)]
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.

14 years agoUse ir_rvalue::variable_referenced instead of open coding it
Ian Romanick [Tue, 18 May 2010 11:53:20 +0000 (13:53 +0200)]
Use ir_rvalue::variable_referenced instead of open coding it

14 years agoir_visit_tree is no longer used, remove ir_visit_tree.{cpp,h}
Ian Romanick [Fri, 14 May 2010 21:32:17 +0000 (14:32 -0700)]
ir_visit_tree is no longer used, remove ir_visit_tree.{cpp,h}

14 years agoReimplement kill_for_derefs using ir_hierarchical_vistor
Ian Romanick [Fri, 14 May 2010 21:31:25 +0000 (14:31 -0700)]
Reimplement kill_for_derefs using ir_hierarchical_vistor

The output of all test cases was verified to be the same using diff.

14 years agoReimplement has_call_callback using ir_hierarchical_vistor
Ian Romanick [Fri, 14 May 2010 21:11:06 +0000 (14:11 -0700)]
Reimplement has_call_callback using ir_hierarchical_vistor

This has the added advantage that it will stop traversing the tree as
soon as the first call is found.

The output of all test cases was verified to be the same using diff.

14 years agoReimplement ir_if_simplicifation_visitor using ir_hierarchical_vistor
Ian Romanick [Fri, 14 May 2010 20:35:27 +0000 (13:35 -0700)]
Reimplement ir_if_simplicifation_visitor using ir_hierarchical_vistor

The output of all test cases was verified to be the same using diff.

14 years agoMake visit_list_elements safe against node removals
Ian Romanick [Fri, 14 May 2010 20:34:43 +0000 (13:34 -0700)]
Make visit_list_elements safe against node removals

14 years agoReimplement ir_function_can_inline_visitor using ir_hierarchical_vistor
Ian Romanick [Fri, 14 May 2010 19:53:33 +0000 (12:53 -0700)]
Reimplement ir_function_can_inline_visitor using ir_hierarchical_vistor

The output of all test cases was verified to be the same using diff.

14 years agoReimplement ir_dead_code_visitor using ir_hierarchical_vistor
Ian Romanick [Fri, 14 May 2010 19:41:22 +0000 (12:41 -0700)]
Reimplement ir_dead_code_visitor using ir_hierarchical_vistor

The output of all test cases was verified to be the same using diff.

14 years agoAdd ir_hierarchical_visitor base class and associated infrastructure
Ian Romanick [Fri, 14 May 2010 19:39:23 +0000 (12:39 -0700)]
Add ir_hierarchical_visitor base class and associated infrastructure

This type of visitor should eventually replace all or almost all
current uses of ir_visitor.

14 years agoReplace find_dead_code with visit_exec_list
Ian Romanick [Tue, 11 May 2010 00:44:57 +0000 (17:44 -0700)]
Replace find_dead_code with visit_exec_list

find_dead_code appears to be an open-coded version of visit_exec_list
that was implemented first.

14 years agoUse ir_rvalue::variable_referenced instead of open-coding it
Ian Romanick [Sat, 15 May 2010 00:36:00 +0000 (17:36 -0700)]
Use ir_rvalue::variable_referenced instead of open-coding it

14 years agoAdd ir_rvalue::variable_referenced
Ian Romanick [Sat, 15 May 2010 00:35:42 +0000 (17:35 -0700)]
Add ir_rvalue::variable_referenced

14 years agoRefresh autogenerated builtin_function.cpp.
Kenneth Graunke [Fri, 30 Apr 2010 22:20:06 +0000 (15:20 -0700)]
Refresh autogenerated builtin_function.cpp.

14 years agoImplement "tan" builtin.
Kenneth Graunke [Tue, 4 May 2010 05:12:35 +0000 (22:12 -0700)]
Implement "tan" builtin.

14 years agoImplement "sin" and "cos" builtins via new expression operators.
Kenneth Graunke [Tue, 4 May 2010 05:11:17 +0000 (22:11 -0700)]
Implement "sin" and "cos" builtins via new expression operators.

14 years agoImplement "cross" builtin.
Kenneth Graunke [Tue, 4 May 2010 04:29:01 +0000 (21:29 -0700)]
Implement "cross" builtin.

14 years agoImplement "fract" builtin.
Kenneth Graunke [Tue, 4 May 2010 03:59:09 +0000 (20:59 -0700)]
Implement "fract" builtin.

14 years agoImplement "sign" builtin via a new expression operator.
Kenneth Graunke [Tue, 4 May 2010 03:05:57 +0000 (20:05 -0700)]
Implement "sign" builtin via a new expression operator.

14 years agoImplement "smoothstep" builtin.
Kenneth Graunke [Tue, 4 May 2010 02:10:04 +0000 (19:10 -0700)]
Implement "smoothstep" builtin.

14 years agoImplement "step" builtin.
Kenneth Graunke [Fri, 30 Apr 2010 22:18:07 +0000 (15:18 -0700)]
Implement "step" builtin.

14 years agoIntegrate generate_builtins.pl into the build process.
Kenneth Graunke [Mon, 3 May 2010 21:39:03 +0000 (14:39 -0700)]
Integrate generate_builtins.pl into the build process.

make will now regenerate builtin_function.cpp whenever you
change/add/remove files in the builtins/* folders.

14 years agoReplace old builtin_function.cpp with new autogenerated one.
Kenneth Graunke [Thu, 29 Apr 2010 06:01:33 +0000 (23:01 -0700)]
Replace old builtin_function.cpp with new autogenerated one.

14 years agoAdd a perl script to generate builtin_function.cpp.
Kenneth Graunke [Thu, 29 Apr 2010 06:00:43 +0000 (23:00 -0700)]
Add a perl script to generate builtin_function.cpp.

Usage: ./builtins/tools/generate_builtins.pl > builtin_function.cpp

14 years agoFix bogus expression typing in various builtins.
Kenneth Graunke [Mon, 3 May 2010 09:40:10 +0000 (02:40 -0700)]
Fix bogus expression typing in various builtins.

14 years agoInitial commit of IR for builtins.
Kenneth Graunke [Thu, 29 Apr 2010 05:57:47 +0000 (22:57 -0700)]
Initial commit of IR for builtins.

These were all generated by Eric's existing builtin_functions.cpp; I split
the uvec* signatures out of 110 into the 130 folder.

14 years agoir_reader: Set function signatures as defined.
Kenneth Graunke [Thu, 29 Apr 2010 06:17:58 +0000 (23:17 -0700)]
ir_reader: Set function signatures as defined.

14 years agoFS gl_FragCoord and and gl_FrontFacing are FS ins, not outs.
Eric Anholt [Thu, 6 May 2010 19:57:23 +0000 (12:57 -0700)]
FS gl_FragCoord and and gl_FrontFacing are FS ins, not outs.

14 years agoFix function call parameter printer to omit extraneous leading comma
Ian Romanick [Fri, 14 May 2010 23:06:41 +0000 (16:06 -0700)]
Fix function call parameter printer to omit extraneous leading comma

The output of all test cases was verified to be the same using diff.

14 years agoReplace many uses of foreach_list with foreach_list_typed
Ian Romanick [Tue, 11 May 2010 00:42:05 +0000 (17:42 -0700)]
Replace many uses of foreach_list with foreach_list_typed

14 years agoexec_list: Add foreach_list_typed and foreach_list_typed_const
Ian Romanick [Tue, 11 May 2010 00:40:41 +0000 (17:40 -0700)]
exec_list: Add foreach_list_typed and foreach_list_typed_const

These variations are parameterized by the type of the nodes in the
list.  This enables skipping the explicit usage of exec_node_data in
the loop body.

14 years agoConvert ast_node use of simple_node to exec_list and exec_node
Ian Romanick [Mon, 10 May 2010 18:17:53 +0000 (11:17 -0700)]
Convert ast_node use of simple_node to exec_list and exec_node

14 years agoexec_list: Add simpler exec_list for-each macros
Ian Romanick [Mon, 10 May 2010 18:17:23 +0000 (11:17 -0700)]
exec_list: Add simpler exec_list for-each macros

14 years agoexec_list: Add macros to get ptr to structure containing a node
Ian Romanick [Mon, 10 May 2010 18:16:24 +0000 (11:16 -0700)]
exec_list: Add macros to get ptr to structure containing a node

This has some ugly hackery to work-around C++ fail.  I have
emperically determined that it works in all the cases that matter.

14 years agoLoop bodies, then-statements, and else-statements are not lists
Ian Romanick [Mon, 10 May 2010 18:10:26 +0000 (11:10 -0700)]
Loop bodies, then-statements, and else-statements are not lists

The statement making up a loop body, a then-statement, or an
else-statement are single nodes.  If the statement is a block, the
single node will be an ast_compound_statement.  There is no need to
loop at the top level when processing these statements.

14 years agoRemove unnecessary include of simple_list.h
Ian Romanick [Mon, 10 May 2010 17:56:03 +0000 (10:56 -0700)]
Remove unnecessary include of simple_list.h

14 years agoStore AST function call parameters in expressions
Ian Romanick [Mon, 10 May 2010 17:47:14 +0000 (10:47 -0700)]
Store AST function call parameters in expressions

Previously the list of function call parameters was stored as a
circular list in ast_expression::subexpressions[1].  They are now
stored as a regular list in ast_expression::expressions.

14 years agoMove optimization pass prototypes to a single header.
Eric Anholt [Wed, 5 May 2010 18:45:30 +0000 (11:45 -0700)]
Move optimization pass prototypes to a single header.

14 years agoir_dead_code_local: Remove redundant assignments within basic blocks.
Eric Anholt [Wed, 5 May 2010 17:37:25 +0000 (10:37 -0700)]
ir_dead_code_local: Remove redundant assignments within basic blocks.

This cleans up a bunch of junk code in some of the GLSL parser tests,
and could potentially help real-world too (particularly after copy
propagation has happened).

14 years agoir_visit_tree: Make sure we visit dereference targets, too.
Eric Anholt [Wed, 5 May 2010 18:07:21 +0000 (11:07 -0700)]
ir_visit_tree: Make sure we visit dereference targets, too.

Found this with the local dead code pass, which never saw variable
dereferences occurring.

14 years agoir_copy_propagation: Fix up the doxygen about the file.
Eric Anholt [Wed, 5 May 2010 16:38:09 +0000 (09:38 -0700)]
ir_copy_propagation: Fix up the doxygen about the file.

14 years agoir_copy_propagation: Return true if we optimized out any assignments.
Eric Anholt [Wed, 5 May 2010 16:31:53 +0000 (09:31 -0700)]
ir_copy_propagation: Return true if we optimized out any assignments.

This may trigger other optimization phases to make more progress themselves.

14 years agoir_copy_propagation: Handle swizzles and array derefs on LHS of assign.
Eric Anholt [Wed, 5 May 2010 16:26:46 +0000 (09:26 -0700)]
ir_copy_propagation: Handle swizzles and array derefs on LHS of assign.

This improves the ACP to not get cleared when more complicated assignments
occur, cleaning up more redundant copies in programs.

14 years agoir_copy_propagation: New pass to rewrite dereferences to avoid copies.
Eric Anholt [Tue, 4 May 2010 20:04:40 +0000 (13:04 -0700)]
ir_copy_propagation: New pass to rewrite dereferences to avoid copies.

This is pretty basic.  Right now it only handles pure assignments --
same type on each side, no swizzling, and only within basic blocks.

14 years agoir_to_mesa.cpp: Fix missing types on some ir_swizzles.
Eric Anholt [Tue, 4 May 2010 00:08:01 +0000 (17:08 -0700)]
ir_to_mesa.cpp: Fix missing types on some ir_swizzles.

Debugging this took forever as I only looked at constructors in ir.cpp
to find who wasn't setting up ->type.  I dislike hiding code (as
opposed to prototypes and definitions) in C++ header files, but in
this case I have only myself to blame.

14 years agoRemove the pedantic C junk.
Eric Anholt [Mon, 3 May 2010 18:41:00 +0000 (11:41 -0700)]
Remove the pedantic C junk.

Mesa doesn't use pedantic ANSI C89, so I have no idea why we would.

14 years agoStore warnings and errors in a parser state infolog.
Eric Anholt [Fri, 30 Apr 2010 01:00:33 +0000 (18:00 -0700)]
Store warnings and errors in a parser state infolog.

Cleans up compile warning about unused state in _mesa_glsl_warning.  We
would want infolog handling roughly like this anyway.

14 years agoQuiet warnings about ir_shader not being handled in places it's not needed.
Eric Anholt [Fri, 30 Apr 2010 00:57:28 +0000 (17:57 -0700)]
Quiet warnings about ir_shader not being handled in places it's not needed.

14 years agoUse the AM_SILENT_RULES when available.
Eric Anholt [Fri, 30 Apr 2010 00:54:52 +0000 (17:54 -0700)]
Use the AM_SILENT_RULES when available.

14 years agoglsl_lexer: Quiet warning about unused unput().
Eric Anholt [Fri, 30 Apr 2010 00:53:26 +0000 (17:53 -0700)]
glsl_lexer: Quiet warning about unused unput().

14 years agoMerge branch 'fixes'
Ian Romanick [Mon, 3 May 2010 17:15:02 +0000 (10:15 -0700)]
Merge branch 'fixes'

14 years agoUse %p rather than %08x when printing pointers to fix compile.
Kenneth Graunke [Thu, 29 Apr 2010 06:18:25 +0000 (23:18 -0700)]
Use %p rather than %08x when printing pointers to fix compile.

14 years agoFix ir_return cloning to actually use the cloned subexpression.
Kenneth Graunke [Sat, 1 May 2010 07:31:35 +0000 (00:31 -0700)]
Fix ir_return cloning to actually use the cloned subexpression.

This caused a nasty bug where the function inliner would create new
variables for each of the formal parameters, but the body would still
reference the old copies.

This was highly visible since the dead code eliminator (rightly) removed
the new declarations, leading to printed IR that referenced non-existent
variable names.

14 years agoFix incorrect comments in function inliner.
Kenneth Graunke [Sat, 1 May 2010 06:38:50 +0000 (23:38 -0700)]
Fix incorrect comments in function inliner.

14 years agoir_dead_code: Fix segfault on handling a return statement with no value.
Eric Anholt [Thu, 29 Apr 2010 20:54:19 +0000 (13:54 -0700)]
ir_dead_code: Fix segfault on handling a return statement with no value.