diff options
author | Eric Anholt <[email protected]> | 2010-08-05 15:22:05 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-08-05 15:34:00 -0700 |
commit | bc4034b243975089c06c4415d4e26edaaaec7a46 (patch) | |
tree | c6a3ae69c5b02f86bcd1bbc224f65eace4c49821 /src/glsl/ir_validate.cpp | |
parent | 8048226b7b1bbe8fd89f9c32fa4fadca4b8760c4 (diff) |
glsl2: Add a pass to convert exp and log to exp2 and log2.
Fixes ir_to_mesa handling of unop_log, which used the weird ARB_vp LOG
opcode that doesn't do what we want. This also lets the multiplication
coefficients in there get constant-folded, possibly.
Fixes:
glsl-fs-log
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r-- | src/glsl/ir_validate.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 701bf21ea61..545fe2799f3 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -183,10 +183,14 @@ ir_validate::visit_leave(ir_expression *ir) case ir_unop_rcp: case ir_unop_rsq: case ir_unop_sqrt: + assert(ir->type == ir->operands[0]->type); + break; + case ir_unop_exp: case ir_unop_log: case ir_unop_exp2: case ir_unop_log2: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); assert(ir->type == ir->operands[0]->type); break; |