Kenneth Graunke [Fri, 23 Jul 2010 00:44:34 +0000 (17:44 -0700)]
ir_constant_expression: Fix broken code for floating point modulus.
It's supposed to be x - y * floor(x/y), not (x - y) * floor(x/y).
Kenneth Graunke [Thu, 22 Jul 2010 00:33:57 +0000 (17:33 -0700)]
glsl2: Refresh autogenerated file builtin_function.cpp.
Kenneth Graunke [Thu, 22 Jul 2010 23:52:32 +0000 (16:52 -0700)]
glsl2/builtins: Add 1.30 bvec variant of the "mix" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:25:49 +0000 (17:25 -0700)]
glsl2/builtins: Fix 1.30 sign implementation for ints.
Kenneth Graunke [Thu, 22 Jul 2010 00:17:44 +0000 (17:17 -0700)]
glsl2/builtins: Fix "mod" builtin to use scalar/vector operations.
Kenneth Graunke [Thu, 22 Jul 2010 23:45:37 +0000 (16:45 -0700)]
glsl2: Initialize ir_instruction::type and ir_rvalue::type.
Top-level instructions now get NULL as their default type (since type is
irrelevant for things like ir_function), while ir_rvalues get error_type
by default.
This should make it easier to tell if we've forgotten to set a type. It
also fixes some "Conditional jump or move depends on uninitialized
value" errors in valgrind caused by ir_validate examining the type of
top level ir_instructions, which weren't set.
Kenneth Graunke [Thu, 22 Jul 2010 23:40:35 +0000 (16:40 -0700)]
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.
Kenneth Graunke [Thu, 22 Jul 2010 23:20:36 +0000 (16:20 -0700)]
glsl2: Fix standalone compiler to not crash horribly.
ir_to_mesa was updated for the _mesa_glsl_parse_state constructor
changes, but main.cpp was not.
Kenneth Graunke [Thu, 22 Jul 2010 23:18:57 +0000 (16:18 -0700)]
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.
Carl Worth [Thu, 22 Jul 2010 23:36:04 +0000 (16:36 -0700)]
glcpp: Fix function-like macros with an argument used multiple times.
It's really hard to believe that this case has been broken, but apparently
no test previously exercised it. So this commit adds such a test and fixes
it by making a copy of the argument token-list before expanding it.
This fix causes the following glean tests to now pass:
glsl1-Preprocessor test 6 (#if 0, #define macro)
glsl1-Preprocessor test 7 (multi-line #define)
Eric Anholt [Thu, 22 Jul 2010 23:30:41 +0000 (16:30 -0700)]
glsl2: Put side effects of the RHS of logic_or in the right branch.
Kind of missing the point to only do the side effects if the LHS
evaluates as true.
Fixes:
glsl1-|| operator, short-circuit
Eric Anholt [Thu, 22 Jul 2010 23:24:49 +0000 (16:24 -0700)]
glsl2: Validate that ir_if conditions are actually bool.
Eric Anholt [Thu, 22 Jul 2010 23:11:08 +0000 (16:11 -0700)]
ir_to_mesa: Fix the swizzles on record and array dereferences.
Fixes:
glsl1-struct (1)
glsl1-struct (2)
glsl1-struct (3)
glsl1-struct (4)
Eric Anholt [Thu, 22 Jul 2010 22:50:37 +0000 (15:50 -0700)]
glsl2: When setting the size of an unsized array, set its deref's size too.
Eric Anholt [Thu, 22 Jul 2010 22:34:01 +0000 (15:34 -0700)]
glsl2: Set the type on cloned tex instructions.
Eric Anholt [Thu, 22 Jul 2010 22:17:23 +0000 (15:17 -0700)]
glsl2: Add the API defines to the glsl2 build so we get the right GLcontext
Fixes:
draw_buffers-08.frag
draw_buffers-09.frag
glsl-vs-texturematrix-2
Eric Anholt [Thu, 22 Jul 2010 21:57:55 +0000 (14:57 -0700)]
glsl2: Fix builtin prototypes defined in multiple glsl/builtins/* files
If we put the protos in separate ir_functions, they wouldn't be found
at lookup time for linking.
Fixes:
glsl-fs-texture2d-bias
glsl-fs-texture2dproj-bias
glsl-fs-texture2dproj-bias-2
glsl-lod-bias
glsl1-texture2D(), computed coordinate
Carl Worth [Thu, 22 Jul 2010 21:56:14 +0000 (14:56 -0700)]
glsl2: Fix expected type for multiplying vector with non-square matrix.
Previously, the compiler expected the result of the multiplication to
be of the same type as the vector. This is correct for square
matrices, but wrong for all others.
We fix this by instead expecting a vector with the same number of rows
as the matrix (for the case of M*v with a column vector) or the same
number of columns as the matrix (for v*M with a row vector).
This fix causes the following four glean tests to now pass:
glsl1-mat4x2 * vec4
glsl1-vec2 * mat4x2 multiply
glsl1-vec3 * mat4x3 multiply
glsl1-vec4 * mat3x4 multiply
Eric Anholt [Thu, 22 Jul 2010 21:25:26 +0000 (14:25 -0700)]
glsl2: Fix the type of (1.0 - arg2) for mix(gen, gen, float).
Previously, we'd constant-fold up a value of vec4(1.0 - arg2, 0, 0, 0).
Fixes:
glsl1-mix(vec4) function
Eric Anholt [Thu, 22 Jul 2010 20:52:41 +0000 (13:52 -0700)]
glsl2: When inlining, don't clone and assign sampler arguments.
Instead, just use the incoming sampler param. Fixes many texture-using
piglit tests since the linker rework.
Eric Anholt [Thu, 22 Jul 2010 19:55:16 +0000 (12:55 -0700)]
glsl2: When a "continue" happens in a "for" loop, run the loop expression.
Fixes:
glsl1-for-loop with continue
Bug #29097
Eric Anholt [Thu, 22 Jul 2010 19:25:39 +0000 (12:25 -0700)]
ir_to_mesa: Pretty up the printing of MESA_GLSL=dump
Eric Anholt [Thu, 22 Jul 2010 19:16:11 +0000 (12:16 -0700)]
mesa: Only complain about an infinite loop in a swrast program once.
Chances are, if one fragment looped badly, others will too, and
debugging output gets overwhelmed by the looping complaints.
Eric Anholt [Thu, 22 Jul 2010 19:11:36 +0000 (12:11 -0700)]
ir_to_mesa: Add support for MESA_GLSL=dump environment var.
Eric Anholt [Thu, 22 Jul 2010 06:21:23 +0000 (23:21 -0700)]
glsl2: Use talloc on InfoLog handling in ValidateProgram
Fixes a segfault in Regnum Online.
Kenneth Graunke [Tue, 20 Jul 2010 20:04:23 +0000 (13:04 -0700)]
glsl2: Update TODO.
Kenneth Graunke [Tue, 20 Jul 2010 10:08:32 +0000 (03:08 -0700)]
ir_constant_expression: Add support for array == and !=.
Piglit parser tests const-array-03.frag and const-array-04.frag now
generate the correct code.
Kenneth Graunke [Tue, 20 Jul 2010 08:31:29 +0000 (01:31 -0700)]
ir_constant_expression: Add support for constant arrays.
Fixes piglit test const-array-02.frag.
Kenneth Graunke [Tue, 20 Jul 2010 08:53:07 +0000 (01:53 -0700)]
ir_reader: Add support for reading constant arrays.
Kenneth Graunke [Tue, 20 Jul 2010 08:28:09 +0000 (01:28 -0700)]
ir_print_visitor: Print out constant arrays.
Kenneth Graunke [Tue, 20 Jul 2010 08:23:12 +0000 (01:23 -0700)]
ir_print_visitor: Remove commas between ir_constant's components.
The IR reader does not expect commas.
Kenneth Graunke [Tue, 20 Jul 2010 08:06:33 +0000 (01:06 -0700)]
glsl2: Extend ir_constant to store constant arrays, and generate them.
Since GLSL permits arrays of structures, we need to store each element
as an ir_constant*, not just ir_constant_data.
Fixes parser tests const-array-01.frag, const-array-03.frag,
const-array-04.frag, const-array-05.frag, though 03 and 04 generate the
wrong code.
Kenneth Graunke [Tue, 20 Jul 2010 06:49:58 +0000 (23:49 -0700)]
glsl2: Emit array constructors inline.
Kenneth Graunke [Tue, 20 Jul 2010 10:53:47 +0000 (03:53 -0700)]
ast_to_hir: Fix bug in constant initializers.
Implicit conversions were not being performed, nor was there any
type checking - it was possible to have, say, var->type == float
and var->constant_value->type == int. Later use of the constant
expression would trigger an assertion.
Fixes piglit test const-implicit-conversion.frag.
Kenneth Graunke [Tue, 20 Jul 2010 20:01:56 +0000 (13:01 -0700)]
ir_constant_expression: Add support for ir_unop_u2f.
Also make ir_unop_i2f only operate on signed integers.
Kenneth Graunke [Tue, 20 Jul 2010 10:01:54 +0000 (03:01 -0700)]
ir_constant_expression: Remove open coded equality comparisons.
The ir_constant::has_value method already does this.
Kenneth Graunke [Tue, 20 Jul 2010 06:45:23 +0000 (23:45 -0700)]
glsl2: Add some comments.
Kenneth Graunke [Tue, 20 Jul 2010 04:44:03 +0000 (21:44 -0700)]
glsl2: Replace insert_before/remove pairs with exec_node::replace_with.
Ian Romanick [Tue, 20 Jul 2010 18:29:46 +0000 (11:29 -0700)]
linker: Link built-in functions instead of including them in every shader
This is an invasive set of changes. Each user shader tracks a set of other
shaders that contain built-in functions. During compilation, function
prototypes are imported from these shaders. During linking, the
shaders are linked with these built-in-function shaders just like with
any other shader.
Ian Romanick [Tue, 20 Jul 2010 18:28:31 +0000 (11:28 -0700)]
glsl2: Add function to import function prototypes from one IR tree to another
Carl Worth [Wed, 21 Jul 2010 20:50:38 +0000 (13:50 -0700)]
ir_to_mesa: Add missing initializion of lod_info variable.
To quiet a compiler warning.
Carl Worth [Wed, 21 Jul 2010 20:43:47 +0000 (13:43 -0700)]
glsl: Fix missing initialization of yylloc.source
In both the preprocessor and in the compiler proper, we use a custom
yyltype struct to allow tracking the source-string number in addition
to line and column. However, we were previously relying on bison's
default initialization of the yyltype struct which of course is not
aware of the source field and leaves it uninitialized.
We fix this by defining our own YYLLOC_DEFAULT macro expanding on the
default version (as appears in the bison manual) and adding
initialization of yylloc.source.
Carl Worth [Wed, 21 Jul 2010 18:23:51 +0000 (11:23 -0700)]
glsl: Correctly handle unary plus operator.
Previously, any occurence of the unary plus operator would trigger a
bogus type mismatch error. Fix this by making the ast_plus case look
more like the ast_neg case as far as type-checking is concerned.
With this change the shaders/CorrectPreprocess8.frag test in piglit
now passes.
Ian Romanick [Tue, 20 Jul 2010 22:33:40 +0000 (15:33 -0700)]
glsl2: glsl_type has its own talloc context, don't pass one in
Ian Romanick [Tue, 20 Jul 2010 20:36:32 +0000 (13:36 -0700)]
linker: Do post-link lowering and optimization
The lowering code should probably be moved elsewhere.
Ian Romanick [Tue, 20 Jul 2010 18:27:38 +0000 (11:27 -0700)]
glsl2: Implement utility routine to talloc reparent an IR tree
Ian Romanick [Sun, 18 Jul 2010 22:59:43 +0000 (15:59 -0700)]
glsl2: Add a constructor for _mesa_glsl_parse_state
Coming changes to the handling of built-in functions necessitate this.
Ian Romanick [Tue, 20 Jul 2010 00:12:42 +0000 (17:12 -0700)]
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'.
Eric Anholt [Wed, 21 Jul 2010 00:19:57 +0000 (17:19 -0700)]
ir_to_mesa: Validate the linked shaders as well.
This caught the failure in cloning of ir_dereference_record.
Eric Anholt [Wed, 21 Jul 2010 00:18:57 +0000 (17:18 -0700)]
glsl2: Check that nodes in a valid tree aren't error-type.
We're good at propagating error types around, but finding when the
first one was triggered can be painful if we aren't paying attention.
Eric Anholt [Wed, 21 Jul 2010 00:17:47 +0000 (17:17 -0700)]
glsl2: strdup the field names used in dereference_record.
Otherwise, after linking and freeing the old data, the pointer would
dangle. Partial fix for glsl1-struct*.
Eric Anholt [Tue, 20 Jul 2010 23:47:25 +0000 (16:47 -0700)]
glsl2: talloc the glsl_struct_field[] we use to look up structure types.
Since the types are singletons across the lifetime of the compiler,
repeatedly compiling a program with the same structure type defined
would drop a copy of the array on the floor per compile.
This is a bit tricky because the static GLSL types are not called with
the talloc-based new, so we have to use the global type context, which
may not be initialized yet.
Eric Anholt [Tue, 20 Jul 2010 23:38:23 +0000 (16:38 -0700)]
glsl2: Don't claim a match on structure types with different field names.
We regularly do lookups on the field names of the structure to find
the types within the struct, so returning a structure type with bad
names will lead to lots of error types being found.
Kenneth Graunke [Sun, 18 Jul 2010 05:50:26 +0000 (22:50 -0700)]
glsl2: Add support for the .length() method on arrays.
Fixes piglit test glsl-array-length, and provides proper error messages
for negative piglit tests array-length-110.frag, array-length-unsized.frag,
and array-length-args.frag.
Kenneth Graunke [Sun, 18 Jul 2010 05:42:35 +0000 (22:42 -0700)]
glsl2: Remove incorrect assertion in the parser.
This assertion is triggered by method calls (i.e. array.length()), where
subexpressions[1] is an ast_function_call expression. Since the
assertion itself had a comment saying it could be removed eventually,
simply do so.
Causes negative glslparser tests array-length-110.frag,
array-length-args.frag, and array-length-unsized.frag to pass, but only
because the length() method is not supported yet.
Kenneth Graunke [Sat, 17 Jul 2010 01:28:44 +0000 (18:28 -0700)]
glsl2: Disallow non-constant array indexing for unsized arrays.
Fixes piglit test unsized-array-non-const-index.vert.
Kenneth Graunke [Thu, 15 Jul 2010 17:27:53 +0000 (10:27 -0700)]
ir_constant_expression: Remove pointless use of variable_referenced.
ir_dereference_variable always references an ir_variable, so there's no
point in calling a function and NULL-checking the result.
Kenneth Graunke [Thu, 15 Jul 2010 17:20:51 +0000 (10:20 -0700)]
ir_constant_expression: Use "this" pointer directly.
In ir_expression's signature, I replaced ir->operands[i] with op[i] as
it is more concise; an assertion already ensures these are equal.
Kenneth Graunke [Thu, 15 Jul 2010 17:09:09 +0000 (10:09 -0700)]
ir_constant_expression: Convert from a visitor to a virtual function.
The constant_expression_wrapper was already the only external API, and
much of the internal code used it anyway. Also, it wouldn't ever visit
non-rvalue ir_instructions, so using a visitor seemed a bit unnecessary.
This uses "ir_foo *ir = this;" lines to avoid code churn. These should
be removed.
Kenneth Graunke [Mon, 12 Jul 2010 20:55:10 +0000 (13:55 -0700)]
glsl2: Move constant_expression_value method to ir_rvalue.
This prevents top-level callers from asking for the value of something
that is guaranteed not to have one.
Carl Worth [Tue, 20 Jul 2010 23:44:03 +0000 (16:44 -0700)]
glcpp: Avoid accidental token pasting in preprocessed result.
Consider this test case:
#define EMPTY
int foo = 1+EMPTY+4;
The expression should compile as the sequence of tokens 1, PLUS,
UNARY_POSITIVE, 4. But glcpp has been failing for this case since it
results in the string "1++4" which a compiler correctly sees as a
syntax error, (1, POST_INCREMENT, 4).
We fix this by changing any macro with an empty definition to result
in a single SPACE token rather than nothing. This then gives "1+ +4"
which compiles correctly.
This commit does touch up the two existing test cases which already
have empty macros, (to add the space to the expected result).
It also adds a new test case to exercise the above scenario.
Carl Worth [Tue, 20 Jul 2010 22:56:02 +0000 (15:56 -0700)]
glcpp: Add missing include in xtalloc.c
Without this, the compiler was legitimately complaining about missing
declarations for all of the functions being defined here.
Carl Worth [Tue, 20 Jul 2010 22:55:21 +0000 (15:55 -0700)]
glcpp: Add static keyword to several functions in the parser.
This quiets warnings about missing declarations otherwise.
Carl Worth [Tue, 20 Jul 2010 22:53:14 +0000 (15:53 -0700)]
glcpp: Avoid warnings in generated flex code.
We define the YY_NO_INPUT macro to avoid one needless function being
generated.
for the other needless functions, (yyunput and yy_top_state), we add a
new UNREACHABLE start condition and call these functions from an
action there. This doesn't change functionality at all, (since we
never enter the UNREACHABLE start condition), but makes the compiler
stop complaining about these two functions being defined but not used.
Carl Worth [Tue, 20 Jul 2010 22:03:20 +0000 (15:03 -0700)]
glcpp-lex: Declare some generated functions to eliminate compiler warnings.
It's really a bug in flex that these functions are generated with neither
a declaration nor the 'static' keyword, but we can at least avoid the
warnings this way.
Carl Worth [Tue, 20 Jul 2010 21:13:32 +0000 (14:13 -0700)]
glcpp: Fix support for nested #ifdef and nested #ifndef
Previously, if the outer #ifdef/#ifndef evaluated to false, the inner
directive would not be parsed correctly, (the identifier as the subject
of the #ifdef/#ifndef would inadvertently be skipped along with the other
content correctly being skipped).
We fix this by setting the lexing_if state in each case here.
We also add a new test to the test suite to ensure that this case is tested.
Carl Worth [Tue, 20 Jul 2010 20:16:17 +0000 (13:16 -0700)]
glcpp: Support #if(expression) with no intervening space.
And add a test case to ensure that this works.
Carl Worth [Tue, 20 Jul 2010 01:02:12 +0000 (18:02 -0700)]
glcpp: Fix use-after-free error from #undef directive.
By taking advantage of the recently-added hash_table_remove function.
With this change, all existing tests are now valgrind-clean.
Carl Worth [Tue, 20 Jul 2010 01:01:43 +0000 (18:01 -0700)]
hash_table: Add new hash_table_remove function.
To allow for the removal of a single element from a hash table.
Carl Worth [Tue, 20 Jul 2010 00:49:23 +0000 (17:49 -0700)]
glcpp: Make test suite test for valgrind cleanliness.
As it turns out, 4 of our current tests are not valgrind clean,
(use after free errors or so), so this will be helpful for
investigating and fixing those.
Carl Worth [Tue, 20 Jul 2010 00:48:17 +0000 (17:48 -0700)]
glcpp: Make test suite report final count of passed/total tests.
And report PASS or FAIL for each test along the way as well.
Carl Worth [Wed, 14 Jul 2010 21:48:15 +0000 (14:48 -0700)]
Build a standalone glcpp binary.
This is convenient for testing the preprocessor independent of the rest of
mesa, (just run glcpp-test in the src/glsl/glcpp/tests).
Carl Worth [Wed, 14 Jul 2010 19:45:58 +0000 (12:45 -0700)]
glcpp: Delete copies of hash_table.c, hash_table.h, and other headers.
These were only ever intended to exist in the original, standalone
implementation of glcpp, (with the idea of dropping them as soon as
the code moved into mesa). The current build system wasn't compiling
this C file, but the presence of the header files could cause problems
if the two copies diverge in the future.
We head those problems off by deleting al of these redundant files.
Eric Anholt [Tue, 20 Jul 2010 23:03:46 +0000 (16:03 -0700)]
glsl2: Fix handling of out values in function inlining.
The parameters[i] is our inlined variables representing the
parameters, so they are always ir_var_auto. Walk the signature params
in handling "out" values like we do for "in" values to find the mode.
Fixes (with the previous 2 commits):
glsl1-function call with in, out params
glsl1-function call with inout params
Eric Anholt [Tue, 20 Jul 2010 21:21:43 +0000 (14:21 -0700)]
glsl2: Don't mark a variable as constant if it was used as an out param.
Eric Anholt [Tue, 20 Jul 2010 22:50:48 +0000 (15:50 -0700)]
glsl2: Always insert function calls into the instruction stream.
If they have a return value, this means putting it into a temporary
and making a deref of the temp be the rvalue, since we don't know if
the rvalue will be used or not.
Eric Anholt [Tue, 20 Jul 2010 21:03:35 +0000 (14:03 -0700)]
glsl2: Add definitions of the builtin constants present in GLSL 1.10.
Fixes:
glsl1-built-in constants
Eric Anholt [Tue, 20 Jul 2010 19:22:37 +0000 (12:22 -0700)]
glsl2: Fix asin() implementation.
I'd flipped around the order of two operations in paren-balancing
adventures, and left out the multiply by sign(x) required for negative x.
Fixes:
glsl1-acos(vec4) function
glsl1-asin(vec4) function
glsl1-atan(vec4) function
Eric Anholt [Tue, 20 Jul 2010 18:56:48 +0000 (11:56 -0700)]
glsl2: notEqual() produces a boolean value, not the base type of the args.
Fixes:
glsl1-vector relational (bvec2 ==,!=)
glsl1-vector relational (vec4 !=)
Eric Anholt [Tue, 20 Jul 2010 18:43:28 +0000 (11:43 -0700)]
glsl2: Constant-fold assignment conditions.
Ian Romanick [Tue, 20 Jul 2010 18:37:45 +0000 (11:37 -0700)]
glsl2: Don't validate IR if there were compilation errors
Eric Anholt [Tue, 20 Jul 2010 18:14:33 +0000 (11:14 -0700)]
ir_to_mesa: Fix swizzled writemasks with swapped component ordering.
I hadn't noticed you could do this, but glsl1 tests caught it. Fixes:
glsl1-Swizzled writemask
glsl1-Swizzled writemask (2)
glsl1-Swizzled writemask (rgba)
glsl1-Swizzled writemask (stpq)
Ian Romanick [Fri, 16 Jul 2010 23:00:07 +0000 (16:00 -0700)]
linker: Remove the FINISHME comment for intrastage linking
Ian Romanick [Fri, 16 Jul 2010 22:52:40 +0000 (15:52 -0700)]
linker: Remove redundant check for 'main' in shaders
This is now handled in link_intrastage_shaders.
Ian Romanick [Fri, 16 Jul 2010 22:51:50 +0000 (15:51 -0700)]
linker: Track and validate GLSL versions used in shaders
Ian Romanick [Fri, 16 Jul 2010 22:31:23 +0000 (15:31 -0700)]
glsl2: Use Elements macro
Ian Romanick [Fri, 16 Jul 2010 03:20:36 +0000 (20:20 -0700)]
linker: Recursively resolve function calls in imported functions
Ian Romanick [Fri, 16 Jul 2010 02:28:32 +0000 (19:28 -0700)]
linker: look up function signatures during linking instead of using callee
Instead of using ir_call::callee, search for the signature in the
linked shader. This will allow resolving calls from functions
imported from other shaders. The ir_call::callee pointer in the
imported function will still reference a signature in the original shader.
Ian Romanick [Thu, 15 Jul 2010 20:32:27 +0000 (13:32 -0700)]
linker: Pull find_matching_signature out of call_link_visitor
The list of shaders to search needs to be provided as an explicit
parameter to support coming changes. At that point there is no reason
for it to be in the class. Also, fix some of the 'const' decorators.
Ian Romanick [Thu, 15 Jul 2010 20:09:25 +0000 (13:09 -0700)]
glsl2: Explicitly walk lists in ir_function::parameter_lists_match
Give ir_function::parameter_lists_match_exist similar treatment. Make
the parameters const, and propogate the constness as far as it will
trivially go.
Ian Romanick [Wed, 14 Jul 2010 20:22:12 +0000 (13:22 -0700)]
linker: Add comment about bug in initializer handling
Ian Romanick [Wed, 14 Jul 2010 00:36:13 +0000 (17:36 -0700)]
linker: First bits of intrastage, intershader function linking
This handles the easy case of linking a function in a different
compilation unit that doesn't call any functions or reference any
global variables.
Ian Romanick [Wed, 14 Jul 2010 00:34:02 +0000 (17:34 -0700)]
ir_function_signature: Make actual_parameters public
Ian Romanick [Wed, 14 Jul 2010 00:31:12 +0000 (17:31 -0700)]
linker: Remove some unnecessary includes
Kenneth Graunke [Mon, 19 Jul 2010 21:49:34 +0000 (14:49 -0700)]
exec_list: Fix foreach_list_safe.
It now works correctly when nodes are removed, as it was originally
intended to do; it no longer processes nodes added to the list before
the current node, nor those added immediately after the current node.
This matches the behavior of Linux's list_for_each_safe.
Ian Romanick [Mon, 19 Jul 2010 19:34:56 +0000 (12:34 -0700)]
linker: Use foreach_list_safe in move_non_declarations
The node being processed may be removed from the list and put in a
different list. Not using the safe version caused list processing to
change streams after moving a node.
Ian Romanick [Mon, 19 Jul 2010 19:33:54 +0000 (12:33 -0700)]
linker: Move global instructions from the linked shader first
For the shader containing 'main', use the linked shader (i.e., the
clone of the original shader that contained main) as the source for
global instructions to move into main.
Eric Anholt [Mon, 19 Jul 2010 18:52:54 +0000 (11:52 -0700)]
glsl2: Fix lexing of octal values, including "0".
When faced with a constructor like 'ivec4(0, 2, 0, 0)', we would
manage to get a value of 2 instead of 0 for the first "0". Usually 2
characters past "0" would point at some junk and lex as 0 anyway.
Fixes glsl-octal and glsl-unused-varyings.
Eric Anholt [Mon, 19 Jul 2010 17:31:03 +0000 (10:31 -0700)]
glsl2: Fix the expression type for atan's pi * sign(y).
Fixes CorrectFunction.vert.
Eric Anholt [Mon, 19 Jul 2010 17:21:58 +0000 (10:21 -0700)]
i915: Ask the compiler to flatten out all the if statements that it can.