Eric Anholt
9be7f63813
glsl2: Make cross() be an expression operation.
...
ARB_fp, ARB_vp, Mesa IR, and the 965 vertex shader all have
instructions for cross. Shaves 12 Mesa instructions off of a
66-instruction shader I have.
2010-07-18 18:12:12 -07:00
Kenneth Graunke
ce5ae5f49d
ir_constant_expression: Add support for ir_binop_mod.
2010-07-14 16:49:24 -07:00
Kenneth Graunke
79fed377f4
ir_constant_expression: Add support for ir_binop_min and ir_binop_max.
...
These now work on scalar/vector combos. Semantically, if a is a scalar,
min(a, vec2(x,y)) == vec2(min(a,x), min(a,y))
2010-07-14 15:50:28 -07:00
Kenneth Graunke
891a0647e4
ir_constant_expression: Add support for ir_binop_pow.
2010-07-14 15:50:28 -07:00
Kenneth Graunke
3fab376bef
ir_constant_expression: Add support for ir_unop_cos.
2010-07-14 15:50:28 -07:00
Kenneth Graunke
908afd16d1
ir_constant_expression: Add support for ir_unop_sin.
2010-07-14 15:50:28 -07:00
Kenneth Graunke
074720477c
ir_constant_expression: Add support for ir_unop_floor.
2010-07-14 15:50:28 -07:00
Kenneth Graunke
c1ee30a145
ir_constant_expression: Add support for ir_unop_ceil.
2010-07-14 15:50:28 -07:00
Kenneth Graunke
323d909ab2
ir_constant_expression: Add support for ir_unop_trunc.
...
This uses a C99 function.
2010-07-14 15:50:28 -07:00
Kenneth Graunke
cb63929df4
ir_constant_expression: Add support for ir_unop_log2.
...
This uses a C99 function.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
aca01edc83
ir_constant_expression: Add support for ir_unop_exp2.
...
This uses a C99 function.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
14b7b2660c
ir_constant_expression: Add support for ir_unop_sign.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
5e840dba44
ir_constant_expression: Remove bogus assert in ir_unop_abs case.
...
abs is defined for integral types; it's even implemented.
2010-07-14 15:50:27 -07:00
Kenneth Graunke
acf88f2769
ir_constant_expression: Fix loop increments.
2010-07-07 12:41:26 -07:00
Eric Anholt
570dc0d400
glsl2: Avoid null deref in scalar constant unop expressions.
2010-07-07 09:07:52 -07:00
Ian Romanick
ca088cc277
glsl2: Clone methods return the type of the thing being cloned
...
This is as opposed to returning the type of the base class of the hierarchy.
2010-07-06 17:44:37 -07:00
Kenneth Graunke
f14e596f11
ir_constant_expression: Declare loop counting variables in the loops.
...
Fixes "name lookup of 'c' changed" warning.
2010-07-06 17:43:56 -07:00
Kenneth Graunke
3f4a0b8bb0
ir_constant_expression: Add support for dot products.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
cf80a4d177
ir_constant_expression: Add support for matrix multiplication.
...
Also handles matrix/vector and vector/matrix multiplication.
Fixes piglit tests const-matrix-multiply-01.frag,
const-matrix-multiply-02.frag, and const-vec-mat.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
37b3f9d0ed
ir_constant_expression: Support scalar * vector and scalar * matrix.
...
The test here is slightly different since we need to keep matrix
multiplication separate.
Fixes piglit tests const-vec-scalar-03.frag and const-mat-scalar-03.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
dad35eb8b0
ir_constant_expression: Support scalar / vector and scalar / matrix.
...
Fixes piglit tests const-vec-scalar-04.frag and const-mat-scalar-04.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
97b44f040a
ir_constant_expression: Support scalar - vector and scalar - matrix.
...
Fixes piglit tests const-vec-scalar-02.frag and const-mat-scalar-02.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
e74dcd7924
ir_constant_expression: Support scalar + vector and scalar + matrix.
...
Fixes piglit tests const-vec-scalar-01.frag, const-vec-scalar-05.frag,
and const-mat-scalar-01.frag.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
6fc983b9bb
ir_constant_expression: Assert that both operands share a base type.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
6bc432e14e
ir_constant_expression: Initialize op[0] and op[1] to NULL.
...
This makes it easy to check if there is a second argument.
2010-07-06 16:03:33 -07:00
Kenneth Graunke
c63a1db81f
ir_constant_expression: Initialize all components of constant data to 0.
...
This is probably just a good idea, and will come in useful when
implementing things like matrix multiplication.
2010-07-06 16:03:32 -07:00
Eric Anholt
d925c91730
glsl2: Add ir_unop_fract as an expression type.
...
Most backends will prefer seeing this to seeing (a - floor(a)), so
represent it explicitly.
2010-07-01 11:07:22 -07:00
Kenneth Graunke
16efab1c4d
glsl2: Define new ir_discard instruction.
2010-06-30 14:54:58 -07:00
Eric Anholt
2928588267
glsl2: Move the compiler to the subdirectory it will live in in Mesa.
2010-06-24 15:36:00 -07:00