summaryrefslogtreecommitdiff
path: root/src/glsl/ir_constant_expression.cpp
AgeCommit message (Collapse)Author
2010-10-15glsl: Implement constant expr evaluation for bitwise logic opsChad Versace
Implement by adding the following cases to ir_exporession::constant_expression_value(): - ir_binop_bit_and - ir_binop_bit_or - ir_binop_bit_xor
2010-10-15glsl: Implement constant expr evaluation for bit-shift opsChad Versace
Implement by adding the following cases to ir_expression::constant_expression_value(): - ir_binop_lshfit - ir_binop_rshfit
2010-10-15glsl: Implement constant expr evaluation for bitwise-notChad Versace
Implement by adding a case to ir_expression::constant_expression_value() for ir_unop_bit_not.
2010-10-13glsl: Initialize variable in ir_derefence_array::constant_expression_valueVinson Lee
Completely initialize data passed to ir_constant constructor. Fixes piglit glsl-mat-from-int-ctor-03 valgrind uninitialized value error on softpipe.
2010-09-20glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.Kenneth Graunke
When ir_binop_all_equal and ir_binop_any_nequal were introduced, the meaning of these two opcodes changed to return vectors rather than a single scalar, but the constant expression handling code was incorrectly written and only worked for scalars. As a result, only the first component of the returned vector would be properly initialized.
2010-09-13glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmpsLuca Barbieri
Currently GLSL IR forbids any vector comparisons, and defines "ir_binop_equal" and "ir_binop_nequal" to compare all elements and give a single bool. This is highly unintuitive and prevents generation of optimal Mesa IR. Hence, first rename "ir_binop_equal" to "ir_binop_all_equal" and "ir_binop_nequal" to "ir_binop_any_nequal". Second, readd "ir_binop_equal" and "ir_binop_nequal" with the same semantics as less, lequal, etc. Third, allow all comparisons to acts on vectors. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-07glsl: Move is_builtin flag back to ir_function_signature.Kenneth Graunke
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.
2010-08-29glsl: Initialize variable in ir_swizzle::constant_expression_value.Vinson Lee
Complete initialize data passed to ir_constant constructor. Fixes piglit glsl-mat-from-int-ctor-02 valgrind unintialized variable error with softpipe and llvmpipe.
2010-08-26glsl: Move is_built_in flag from ir_function_signature to ir_function.Kenneth Graunke
Also rename it to "is_builtin" for consistency. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-24glsl: Include main/core.h.Chia-I Wu
Make glsl include only main/core.h from core mesa.
2010-08-23mesa: Add new ir_unop_any() expression operation.Eric Anholt
The previous any() implementation would generate arg0.x || arg0.y || arg0.z. Having an expression operation for this makes it easy for the backend to generate something easier (DPn + SNE for 915 FS, .any predication on 965 VS)
2010-08-18ir_constant_expression: Implement equal/notEqual for booleans.Kenneth Graunke
Calls to equal(bvec, bvec) or notEqual(bvec, bvec) previously caused an assertion. Fixes piglit tests glsl-const-builtin-equal-bool and glsl-const-builtin-notEqual-bool.
2010-08-04glsl2: Skip talloc_parent in constant_expression of non-constant arrays.Eric Anholt
2010-08-04glsl2: Make the clone() method take a talloc context.Eric Anholt
In most cases, we needed to be reparenting the cloned IR to a different context (for example, to the linked shader instead of the unlinked shader), or optimization before the reparent would cause memory usage of the original object to grow and grow.
2010-08-02glsl2: Fix typo in clamp() constant builtin using uint instead of int.Eric Anholt
I take back the bad things I've said about the signed/unsigned comparison warning now.
2010-08-02glsl2: Don't consider uniform initializers as constant expressions.Eric Anholt
We were happily optimizing away the body of glsl-uniform-initializer-* to never use the uniforms.
2010-07-28ir_constant_expression: Add support for the "outerProduct" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "mix" builtin.Kenneth Graunke
Both 1.10 and 1.30 variants.
2010-07-28ir_constant_expression: Add support for the "transpose" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "smoothstep" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "clamp" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "step" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "faceforward" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "refract" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "reflect" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "normalize" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "matrixCompMult" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Simplify code that implements the "dot" builtin.Kenneth Graunke
There's no need to use an ir_expression; we have a handy C function.
2010-07-28ir_constant_expression: Add support for the "length" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Extract dot product calculation for reuse.Kenneth Graunke
2010-07-28ir_constant_expression: Remove support for dot products of integers.Kenneth Graunke
This shouldn't be required since dot is only defined for floating point types, even in GLSL 4.0.
2010-07-28ir_constant_expression: Add support for the "greaterThanEqual" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "greaterThan" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "lessThanEqual" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "lessThan" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "notEqual" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "equal" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "distance" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "degrees" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "radians" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "tanh" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "tan" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "sinh" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for the "cosh" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for "atan" builtins.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for "acos" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for "asin" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for "any" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Add support for "all" builtin.Kenneth Graunke
2010-07-28ir_constant_expression: Implement builtins that wrap an expression.Kenneth Graunke
These builtin functions are represented by ir_expression_operations, so we can just create one of those and ask for its value.