mesa.git
14 years agoglsl2: Set ir_discard::ir_type when cloning it
Aras Pranckevicius [Wed, 4 Aug 2010 14:31:04 +0000 (16:31 +0200)]
glsl2: Set ir_discard::ir_type when cloning it

Fixes unset ir_type after inlining.

14 years agoglsl2: Fix ir_validate validating null variable names.
Eric Anholt [Tue, 3 Aug 2010 18:43:25 +0000 (11:43 -0700)]
glsl2: Fix ir_validate validating null variable names.

An unnamed variable in a prototype will have a NULL ->name, so don't
worry about storage then.

Fixes:
CorrectFunction1.vert
CorrectParse1.frag

14 years agoglsl2: No need to strdup the name passed in to ir_variable constructor.
Eric Anholt [Tue, 3 Aug 2010 18:40:26 +0000 (11:40 -0700)]
glsl2: No need to strdup the name passed in to ir_variable constructor.

ir_variable always strdups the incoming name so that it matches the
lifetime of the ir_variable.

14 years agoglsl2: Fix typo in clamp() constant builtin using uint instead of int.
Eric Anholt [Tue, 3 Aug 2010 00:49:01 +0000 (17:49 -0700)]
glsl2: Fix typo in clamp() constant builtin using uint instead of int.

I take back the bad things I've said about the signed/unsigned
comparison warning now.

14 years agoir_to_mesa: Add support for 1.20 uniform initializers.
Eric Anholt [Tue, 3 Aug 2010 00:05:48 +0000 (17:05 -0700)]
ir_to_mesa: Add support for 1.20 uniform initializers.

Fixes:
glsl-uniform-initializer-1
glsl-uniform-initializer-2
glsl-uniform-initializer-3
glsl-uniform-initializer-4
glsl1-GLSL 1.20 uniform array constructor

14 years agoglsl2: Don't consider uniform initializers as constant expressions.
Eric Anholt [Mon, 2 Aug 2010 22:31:28 +0000 (15:31 -0700)]
glsl2: Don't consider uniform initializers as constant expressions.

We were happily optimizing away the body of
glsl-uniform-initializer-* to never use the uniforms.

14 years agoInitialize a couple of HasIndex2 fields on Mesa IR src regs.
Eric Anholt [Mon, 2 Aug 2010 23:59:20 +0000 (16:59 -0700)]
Initialize a couple of HasIndex2 fields on Mesa IR src regs.

14 years agoir_to_mesa: Support for struct uniforms.
Eric Anholt [Mon, 2 Aug 2010 21:32:52 +0000 (14:32 -0700)]
ir_to_mesa: Support for struct uniforms.

Fixes glsl-uniform-struct.

14 years agoir_to_mesa: Add a constructor for ir_to_mesa_src_reg.
Eric Anholt [Mon, 2 Aug 2010 21:47:10 +0000 (14:47 -0700)]
ir_to_mesa: Add a constructor for ir_to_mesa_src_reg.

This helps makes sure we don't miss any new fields, and makes totally
uninitialized src_regs be PROGRAM_UNDEFINED.

14 years agoglsl2: Use talloc_zero_size instead of talloc_size to allocate ast_node objects.
Carl Worth [Tue, 3 Aug 2010 00:27:56 +0000 (17:27 -0700)]
glsl2: Use talloc_zero_size instead of talloc_size to allocate ast_node objects.

This is a zero-ing function, (like calloc), to avoid bugs due to
accessing uninitialized values. Thanks to valgrind for noticing the
use of uninitialized values.

14 years agoglsl_type: Use string key for array type hash
Ian Romanick [Mon, 2 Aug 2010 20:41:04 +0000 (13:41 -0700)]
glsl_type: Use string key for array type hash

14 years agoKeep a local copy of the symbol name in the symbol table
Ian Romanick [Mon, 2 Aug 2010 19:49:20 +0000 (12:49 -0700)]
Keep a local copy of the symbol name in the symbol table

The symbol_header structure that tracks symbols with a particular name
may have a different (longer) life time than the symbols it tracks.
Not keeping a local copy of the name can lead to use-after-free
errors.  For example, the following sequence would trigger such an
error:

    char *copy = strdup(name);

    _mesa_symbol_table_push_scope(st);
    _mesa_symbol_table_add_symbol(st, 0, name, NULL);
    _mesa_symbol_table_pop_scope(st);
    free(name);
    _mesa_symbol_table_find_symbol(st, 0, copy);

With this change, the symbol table keeps a local copy of the name that
has the same life time as the symbol_header for that name.  This
resolves some use-after-free errors with built-in functions in the
GLSL compiler.

14 years agoglsl2: Clean-up two 'unused variable' warnings
Ian Romanick [Mon, 2 Aug 2010 18:46:22 +0000 (11:46 -0700)]
glsl2: Clean-up two 'unused variable' warnings

14 years agoglsl2: Make glsl_types::ctx private again
Ian Romanick [Mon, 2 Aug 2010 18:35:14 +0000 (11:35 -0700)]
glsl2: Make glsl_types::ctx private again

14 years agoglsl2: Fix expression type in builtin tan().
Eric Anholt [Mon, 2 Aug 2010 19:28:38 +0000 (12:28 -0700)]
glsl2: Fix expression type in builtin tan().

Fixes glsl-fs-tan-1.

14 years agoglsl2: Add validation that talloc ownership of ir_* names is right.
Eric Anholt [Mon, 2 Aug 2010 19:08:52 +0000 (12:08 -0700)]
glsl2: Add validation that talloc ownership of ir_* names is right.

14 years agoglsl2: Fix validation for ir_unop_not.
Eric Anholt [Mon, 2 Aug 2010 19:06:34 +0000 (12:06 -0700)]
glsl2: Fix validation for ir_unop_not.

We use vector ir_unop_not to implement builtin not(), and that seems fine.

14 years agoglsl2: Add support for floating constants like "1f".
Eric Anholt [Mon, 2 Aug 2010 18:26:43 +0000 (11:26 -0700)]
glsl2: Add support for floating constants like "1f".

Fixes glsl-floating-constant-120.

14 years agoglsl2: Initialize the ARB_fcc fields of ir_variable.
Eric Anholt [Mon, 2 Aug 2010 18:20:32 +0000 (11:20 -0700)]
glsl2: Initialize the ARB_fcc fields of ir_variable.

Fixes intermittent failure in glsl-arb-fragment-coord-conventions.

14 years agoglsl2: Also initialize the identifier field of parameter_declarator.
Eric Anholt [Mon, 2 Aug 2010 18:04:54 +0000 (11:04 -0700)]
glsl2: Also initialize the identifier field of parameter_declarator.

The non-named parameter grammar understandably doesn't set the
identifier field.  Fixes intermittent failures about void main(void)
{} having a named void parameter.

14 years agoglsl2: Fix spelling of "precision" in error output.
Eric Anholt [Mon, 2 Aug 2010 17:54:22 +0000 (10:54 -0700)]
glsl2: Fix spelling of "precision" in error output.

14 years agoglsl2: Don't add mesa/program/ as an include dir. Let includes say program/.
Eric Anholt [Mon, 2 Aug 2010 17:49:29 +0000 (10:49 -0700)]
glsl2: Don't add mesa/program/ as an include dir.  Let includes say program/.

14 years agoglsl2: Give the path within src/mesa/ for headers instead of relying on -I.
Aras Pranckevicius [Thu, 29 Jul 2010 09:40:49 +0000 (12:40 +0300)]
glsl2: Give the path within src/mesa/ for headers instead of relying on -I.

14 years agoglsl2: initialize is_array and array_size of ast_parameter_declarator
Aras Pranckevicius [Mon, 2 Aug 2010 07:22:26 +0000 (10:22 +0300)]
glsl2: initialize is_array and array_size of ast_parameter_declarator

The non-array path of glsl_parser.ypp wasn't setting is_array to false.

14 years agoglsl2: Make non-square matrix keywords not keywords pre-120.
Eric Anholt [Mon, 2 Aug 2010 01:44:21 +0000 (18:44 -0700)]
glsl2: Make non-square matrix keywords not keywords pre-120.

Fixes glsl-mat-110.

14 years agoir_to_mesa: Add support for MESA_GLSL=log.
Eric Anholt [Sun, 1 Aug 2010 18:40:41 +0000 (11:40 -0700)]
ir_to_mesa: Add support for MESA_GLSL=log.

This is the option that dumps shader source to files in the current
directory.

14 years agoglcpp: Add a testcase for the failure in compiling xonotic's shader.
Eric Anholt [Sun, 1 Aug 2010 18:40:07 +0000 (11:40 -0700)]
glcpp: Add a testcase for the failure in compiling xonotic's shader.

gcc and mesa master agree that this is OK.

14 years agoglsl2: Do algebraic optimizations after linking as well.
Eric Anholt [Sat, 31 Jul 2010 22:47:35 +0000 (15:47 -0700)]
glsl2: Do algebraic optimizations after linking as well.

Linking brings in inlining of builtins, so we weren't catching the
(rcp(/sqrt(x)) -> rsq(x)) without it.

14 years agoglsl2: Add new tree grafting optimization pass.
Eric Anholt [Sat, 31 Jul 2010 00:04:49 +0000 (17:04 -0700)]
glsl2: Add new tree grafting optimization pass.

14 years agoglsl2: Factor out the variable refcounting part of ir_dead_code.cpp.
Eric Anholt [Fri, 30 Jul 2010 23:05:27 +0000 (16:05 -0700)]
glsl2: Factor out the variable refcounting part of ir_dead_code.cpp.

14 years agoglsl2: Fix stack smash when ternary selection is used.
Aras Pranckevicius [Thu, 29 Jul 2010 12:35:22 +0000 (15:35 +0300)]
glsl2: Fix stack smash when ternary selection is used.

14 years agoglsl2: Fix the implementation of atan(y, x).
Eric Anholt [Fri, 30 Jul 2010 17:20:34 +0000 (10:20 -0700)]
glsl2: Fix the implementation of atan(y, x).

So many problems here.  One is that we can't do the quadrant handling
for all the channels at the same time, so we call the float(y, x)
version multiple times.  I'd also left out the x == 0 handling.  Also,
the quadrant handling was broken for y == 0, so there was a funny
discontinuity on the +x side if you plugged in obvious values to test.

I generated the atan(float y, float x) code from a short segment of
GLSL and pasted it in by hand.  It would be nice to automate that
somehow.

Fixes:
glsl-fs-atan-1
glsl-fs-atan-2

14 years agoast: Initialize location data in constructor of all ast_node objects.
Carl Worth [Thu, 29 Jul 2010 23:39:36 +0000 (16:39 -0700)]
ast: Initialize location data in constructor of all ast_node objects.

This prevents using uninitialized data in _msea_glsl_error in some
cases, (including at least 6 piglit tests). Thanks to valgrind for
pointing out the problem!

14 years agoir_to_mesa: Add the function name as a comment to BGNSUB and ENDSUB.
Eric Anholt [Fri, 30 Jul 2010 21:44:09 +0000 (14:44 -0700)]
ir_to_mesa: Add the function name as a comment to BGNSUB and ENDSUB.

14 years agoglsl2: Update the callee pointer of calls to newly-linked-in functions.
Eric Anholt [Fri, 30 Jul 2010 18:24:23 +0000 (11:24 -0700)]
glsl2: Update the callee pointer of calls to newly-linked-in functions.

Otherwise, ir_function_inlining will see the body of the function from
the unlinked version of the shader, which won't have had the lowering
passes done on it or linking's variable remapping.

14 years agoglsl2: Initialize ir_function_signature::is_built_in.
Kenneth Graunke [Fri, 30 Jul 2010 20:30:11 +0000 (13:30 -0700)]
glsl2: Initialize ir_function_signature::is_built_in.

Fixes a valgrind error.

14 years agoglcpp: Don't look for backslashes before the beginning of the string.
Kenneth Graunke [Fri, 30 Jul 2010 20:24:50 +0000 (13:24 -0700)]
glcpp: Don't look for backslashes before the beginning of the string.

Fixes a valgrind error.

14 years agoglsl2: Do ir_if_return on the way out, not the way in.
Eric Anholt [Thu, 29 Jul 2010 22:49:14 +0000 (15:49 -0700)]
glsl2: Do ir_if_return on the way out, not the way in.

The problem with doing it on the way in is that for a function with
multiple early returns, we'll move an outer block in, then restart the
pass, then move the two inside returns out, then never move outer
blocks in again because the remaining early returns are inside an else
block and they don't know that there's a return just after their
block.  By going inside-out, we get the early returns stacked up so
that they all move out with a series of
move_returns_after_block().

Fixes (on i965):
glsl-fs-raytrace-bug27060
glsl-vs-raytrace-bug26691

14 years agoglsl2: Make sure functions end with a return before doing ir_if_return.
Eric Anholt [Thu, 29 Jul 2010 20:29:17 +0000 (13:29 -0700)]
glsl2: Make sure functions end with a return before doing ir_if_return.

This catches a few remaining functions that weren't getting inlined,
generally operating on global or out variables and using an early
return to skip work when possible.

Fixes for i965:
glsl1-function with early return (3)

14 years agoglsl2: Make ir_if_return handle if () { return } else { not return }
Eric Anholt [Thu, 29 Jul 2010 19:36:06 +0000 (12:36 -0700)]
glsl2: Make ir_if_return handle if () { return } else { not return }

This makes many remaining functions inlinable.

Fixes for i965:
glsl1-function with early return (1)
glsl1-function with early return (2)

14 years agoglsl2: Refactor a bit of ir_if_return for the next changes.
Eric Anholt [Thu, 29 Jul 2010 19:15:04 +0000 (12:15 -0700)]
glsl2: Refactor a bit of ir_if_return for the next changes.

14 years agoir_to_mesa: Don't emit a duplicate return at the end of a function.
Eric Anholt [Thu, 29 Jul 2010 22:17:23 +0000 (15:17 -0700)]
ir_to_mesa: Don't emit a duplicate return at the end of a function.

It was harmless, but ugly.

14 years agoglsl2: Allow use of _mesa_print_ir without a parse state on hand.
Eric Anholt [Thu, 29 Jul 2010 22:04:45 +0000 (15:04 -0700)]
glsl2: Allow use of _mesa_print_ir without a parse state on hand.

14 years agoir_constant_variable: Don't mark variable from outside our scope as constant.
Eric Anholt [Thu, 29 Jul 2010 21:54:01 +0000 (14:54 -0700)]
ir_constant_variable: Don't mark variable from outside our scope as constant.

Fixes (with software, except for alpha):
glsl1-function with early return(3)

14 years agoglsl2: When dumping IR for debug, indent nested blocks.
Eric Anholt [Thu, 29 Jul 2010 21:36:59 +0000 (14:36 -0700)]
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.

14 years agoglsl2: When dumping IR for debug, skip all the empty builtin prototypes.
Eric Anholt [Thu, 29 Jul 2010 21:20:39 +0000 (14:20 -0700)]
glsl2: When dumping IR for debug, skip all the empty builtin prototypes.

14 years agoglsl2: Fix spelling of "sentinel."
Eric Anholt [Thu, 29 Jul 2010 20:52:25 +0000 (13:52 -0700)]
glsl2: Fix spelling of "sentinel."

14 years agoglsl2: Fix spelling of "initializer."
Eric Anholt [Thu, 29 Jul 2010 20:50:17 +0000 (13:50 -0700)]
glsl2: Fix spelling of "initializer."

14 years agoglsl2: Remove an inlined unvalued return statement.
Eric Anholt [Thu, 29 Jul 2010 20:42:39 +0000 (13:42 -0700)]
glsl2: Remove an inlined unvalued return statement.

We already have asserts that it was the last call in the function, so
it's safe to remove after it got cloned in.

Fixes:
glsl-fs-functions-4.

14 years agoglsl2: Actually fix glsl-version-define.
Eric Anholt [Thu, 29 Jul 2010 00:36:07 +0000 (17:36 -0700)]
glsl2: Actually fix glsl-version-define.

14 years agoglcpp: Add __VERSION__ define to the current language version.
Eric Anholt [Wed, 28 Jul 2010 23:58:39 +0000 (16:58 -0700)]
glcpp: Add __VERSION__ define to the current language version.

Fixes:
glsl-version-define
glsl-version-define-110
glsl-version-define-120

14 years agoglcpp: Print integer tokens as decimal, not hex.
Eric Anholt [Wed, 28 Jul 2010 23:53:51 +0000 (16:53 -0700)]
glcpp: Print integer tokens as decimal, not hex.

14 years agoglsl2: Make lowp, mediump, highp, and precision identifiers pre-1.20.
Eric Anholt [Wed, 28 Jul 2010 23:11:26 +0000 (16:11 -0700)]
glsl2: Make lowp, mediump, highp, and precision identifiers pre-1.20.

Fixes glsl-precision-110.

14 years agoglsl2/Makefile: Append to DEFINES rather than replacing them.
Kenneth Graunke [Wed, 28 Jul 2010 23:44:56 +0000 (16:44 -0700)]
glsl2/Makefile: Append to DEFINES rather than replacing them.

Otherwise, we lose DEBUG, which causes mtypes.h to set NDEBUG, which
causes assertions to not happen, which is no fun for anyone.

14 years agoir_to_mesa: Respect the driver if it rejects a shader.
Eric Anholt [Wed, 28 Jul 2010 22:42:35 +0000 (15:42 -0700)]
ir_to_mesa: Respect the driver if it rejects a shader.

14 years agoglsl2: Fix outerProduct builtin.
Kenneth Graunke [Wed, 28 Jul 2010 18:58:27 +0000 (11:58 -0700)]
glsl2: Fix outerProduct builtin.

The type signatures were completely backwards.

14 years agoir_constant_expression: Add support for the "outerProduct" builtin.
Kenneth Graunke [Fri, 23 Jul 2010 20:24:09 +0000 (13:24 -0700)]
ir_constant_expression: Add support for the "outerProduct" builtin.

14 years agoir_constant_expression: Add support for the "mix" builtin.
Kenneth Graunke [Fri, 23 Jul 2010 19:36:50 +0000 (12:36 -0700)]
ir_constant_expression: Add support for the "mix" builtin.

Both 1.10 and 1.30 variants.

14 years agoir_constant_expression: Add support for the "transpose" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 22:34:49 +0000 (15:34 -0700)]
ir_constant_expression: Add support for the "transpose" builtin.

14 years agoir_constant_expression: Add support for the "smoothstep" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 05:37:50 +0000 (22:37 -0700)]
ir_constant_expression: Add support for the "smoothstep" builtin.

14 years agoir_constant_expression: Add support for the "clamp" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 05:23:17 +0000 (22:23 -0700)]
ir_constant_expression: Add support for the "clamp" builtin.

14 years agoir_constant_expression: Add support for the "step" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 04:53:40 +0000 (21:53 -0700)]
ir_constant_expression: Add support for the "step" builtin.

14 years agoir_constant_expression: Add support for the "faceforward" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 04:46:16 +0000 (21:46 -0700)]
ir_constant_expression: Add support for the "faceforward" builtin.

14 years agoir_constant_expression: Add support for the "refract" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 03:33:42 +0000 (20:33 -0700)]
ir_constant_expression: Add support for the "refract" builtin.

14 years agoir_constant_expression: Add support for the "reflect" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 03:24:29 +0000 (20:24 -0700)]
ir_constant_expression: Add support for the "reflect" builtin.

14 years agoir_constant_expression: Add support for the "normalize" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 03:19:32 +0000 (20:19 -0700)]
ir_constant_expression: Add support for the "normalize" builtin.

14 years agoir_constant_expression: Add support for the "matrixCompMult" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 03:03:55 +0000 (20:03 -0700)]
ir_constant_expression: Add support for the "matrixCompMult" builtin.

14 years agoir_constant_expression: Simplify code that implements the "dot" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 03:12:43 +0000 (20:12 -0700)]
ir_constant_expression: Simplify code that implements the "dot" builtin.

There's no need to use an ir_expression; we have a handy C function.

14 years agoir_constant_expression: Add support for the "length" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 01:26:00 +0000 (18:26 -0700)]
ir_constant_expression: Add support for the "length" builtin.

14 years agoir_constant_expression: Extract dot product calculation for reuse.
Kenneth Graunke [Thu, 22 Jul 2010 03:09:21 +0000 (20:09 -0700)]
ir_constant_expression: Extract dot product calculation for reuse.

14 years agoir_constant_expression: Remove support for dot products of integers.
Kenneth Graunke [Thu, 22 Jul 2010 01:18:16 +0000 (18:18 -0700)]
ir_constant_expression: Remove support for dot products of integers.

This shouldn't be required since dot is only defined for floating point
types, even in GLSL 4.0.

14 years agoir_constant_expression: Add support for the "greaterThanEqual" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 01:08:05 +0000 (18:08 -0700)]
ir_constant_expression: Add support for the "greaterThanEqual" builtin.

14 years agoir_constant_expression: Add support for the "greaterThan" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 01:07:43 +0000 (18:07 -0700)]
ir_constant_expression: Add support for the "greaterThan" builtin.

14 years agoir_constant_expression: Add support for the "lessThanEqual" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 01:07:09 +0000 (18:07 -0700)]
ir_constant_expression: Add support for the "lessThanEqual" builtin.

14 years agoir_constant_expression: Add support for the "lessThan" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 01:06:18 +0000 (18:06 -0700)]
ir_constant_expression: Add support for the "lessThan" builtin.

14 years agoir_constant_expression: Add support for the "notEqual" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 01:05:36 +0000 (18:05 -0700)]
ir_constant_expression: Add support for the "notEqual" builtin.

14 years agoir_constant_expression: Add support for the "equal" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 01:04:22 +0000 (18:04 -0700)]
ir_constant_expression: Add support for the "equal" builtin.

14 years agoir_constant_expression: Add support for the "distance" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 01:01:22 +0000 (18:01 -0700)]
ir_constant_expression: Add support for the "distance" builtin.

14 years agoir_constant_expression: Add support for the "degrees" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:59:00 +0000 (17:59 -0700)]
ir_constant_expression: Add support for the "degrees" builtin.

14 years agoir_constant_expression: Add support for the "radians" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:58:03 +0000 (17:58 -0700)]
ir_constant_expression: Add support for the "radians" builtin.

14 years agoir_constant_expression: Add support for the "tanh" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:51:23 +0000 (17:51 -0700)]
ir_constant_expression: Add support for the "tanh" builtin.

14 years agoir_constant_expression: Add support for the "tan" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:50:50 +0000 (17:50 -0700)]
ir_constant_expression: Add support for the "tan" builtin.

14 years agoir_constant_expression: Add support for the "sinh" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:49:56 +0000 (17:49 -0700)]
ir_constant_expression: Add support for the "sinh" builtin.

14 years agoir_constant_expression: Add support for the "cosh" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:47:55 +0000 (17:47 -0700)]
ir_constant_expression: Add support for the "cosh" builtin.

14 years agoir_constant_expression: Add support for "atan" builtins.
Kenneth Graunke [Thu, 22 Jul 2010 00:42:23 +0000 (17:42 -0700)]
ir_constant_expression: Add support for "atan" builtins.

14 years agoir_constant_expression: Add support for "acos" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:39:47 +0000 (17:39 -0700)]
ir_constant_expression: Add support for "acos" builtin.

14 years agoir_constant_expression: Add support for "asin" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:38:38 +0000 (17:38 -0700)]
ir_constant_expression: Add support for "asin" builtin.

14 years agoir_constant_expression: Add support for "any" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:35:52 +0000 (17:35 -0700)]
ir_constant_expression: Add support for "any" builtin.

14 years agoir_constant_expression: Add support for "all" builtin.
Kenneth Graunke [Thu, 22 Jul 2010 00:34:32 +0000 (17:34 -0700)]
ir_constant_expression: Add support for "all" builtin.

14 years agoir_constant_expression: Implement builtins that wrap an expression.
Kenneth Graunke [Wed, 21 Jul 2010 23:57:53 +0000 (16:57 -0700)]
ir_constant_expression: Implement builtins that wrap an expression.

These builtin functions are represented by ir_expression_operations, so
we can just create one of those and ask for its value.

14 years agoir_constant_expression: Add support for builtins dFdx, dFdy, and fwidth.
Kenneth Graunke [Wed, 21 Jul 2010 23:57:10 +0000 (16:57 -0700)]
ir_constant_expression: Add support for builtins dFdx, dFdy, and fwidth.

These always return zero (the derivative of a constant).

14 years agoast_function: Set constant_value on return value temporaries in 1.20+.
Kenneth Graunke [Fri, 23 Jul 2010 01:29:29 +0000 (18:29 -0700)]
ast_function: Set constant_value on return value temporaries in 1.20+.

14 years agoir_constant_expression: Stub out support for constant builtins.
Kenneth Graunke [Wed, 21 Jul 2010 23:55:46 +0000 (16:55 -0700)]
ir_constant_expression: Stub out support for constant builtins.

14 years agoir_constant_expression: Use Mesa's MIN2/MAX2 instead of our own.
Kenneth Graunke [Thu, 22 Jul 2010 04:56:13 +0000 (21:56 -0700)]
ir_constant_expression: Use Mesa's MIN2/MAX2 instead of our own.

14 years agoir_algebraic: Use ir_constant::zero.
Kenneth Graunke [Wed, 28 Jul 2010 19:20:38 +0000 (12:20 -0700)]
ir_algebraic: Use ir_constant::zero.

14 years agoglsl2: Add new ir_constant::zero static method.
Kenneth Graunke [Wed, 21 Jul 2010 22:54:15 +0000 (15:54 -0700)]
glsl2: Add new ir_constant::zero static method.

This conveniently creates a zero value of whatever type you want.

14 years agoglsl2: Add the define for ARB_fragment_coord_conventions when present.
Eric Anholt [Wed, 28 Jul 2010 21:58:31 +0000 (14:58 -0700)]
glsl2: Add the define for ARB_fragment_coord_conventions when present.

Fixes:
glsl-arb-fragment-coord-conventions-define

14 years agoglsl2: Add support for redeclaring layout of gl_FragCoord for ARB_fcc.
Eric Anholt [Wed, 28 Jul 2010 21:41:51 +0000 (14:41 -0700)]
glsl2: Add support for redeclaring layout of gl_FragCoord for ARB_fcc.

Fixes:
glsl-arb-fragment-coord-conventions

14 years agoglsl2: Perform some semantic checking of ARB_fcc layout qualifiers
Ian Romanick [Thu, 1 Jul 2010 00:48:09 +0000 (17:48 -0700)]
glsl2: Perform some semantic checking of ARB_fcc layout qualifiers

The rest cannot be handled until built-in variables (i.e.,
gl_FragCoord) can be redeclared to add qualifiers.

14 years agoglsl2: Parser support for GL_ARB_fragment_coord_conventions
Ian Romanick [Thu, 1 Jul 2010 00:30:03 +0000 (17:30 -0700)]
glsl2: Parser support for GL_ARB_fragment_coord_conventions