glsl: Add unary operation ir_unop_f2u.
authorPaul Berry <stereotype441@gmail.com>
Wed, 13 Jun 2012 22:47:45 +0000 (15:47 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 15 Jun 2012 15:58:55 +0000 (08:58 -0700)
commit8e31f961e6cfd9680b33647c053b0f708abb8a18
tree0b4111a4ddc78710c2bb917267ba6b54f91cee08
parent75f409d75cacf90df2d6f1d718251a5d5cd92f7f
glsl: Add unary operation ir_unop_f2u.

Previously, we performed conversions from float->uint by a two step
process: float->int->uint.  However, on platforms that use saturating
conversions (e.g. i965), this didn't work, because if the source value
was larger than the maximum representable int (0x7fffffff), then
converting it to an int would clamp it to 0x7fffffff.

This patch just adds the new opcode; further patches will adapt
optimization passes and back-ends to use it, and then finally the
ast_to_hir logic will be modified to emit the new opcode.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir.cpp
src/glsl/ir.h
src/glsl/ir_validate.cpp