mesa/src
Bryan Cain 691cc0e3a8 glsl_to_tgsi: implement ir_binop_logic_or using an add w/saturate or add w/SLT
Logical-or is implemented using addition (followed by clamping to [0,1]) on
values of 0.0 and 1.0. Replacing the logical-or operators with addition gives
a + b which has a result on the range [0, 2].

Previously a SNE instruction was used to clamp the resulting logic value to
[0,1]. In a fragment shader, using a saturate on the add has the same effect.
Adding the saturate to the add is free, so (at least) one instruction is
saved. In a vertex shader, using an SLT on the negation of the add result has
the same effect. Many older shader architectures do not support the SNE
instruction. It must be emulated using two SLT instructions and an ADD. On
these architectures, the single SLT saves two instructions.

Note that SNE is still used when integers are used for boolean values, since
there is no such thing as an integer saturate, and older shader architectures
without SNE don't support integers.

This is a port of commit 41f8ffe5e0 to glsl_to_tgsi with integer support
added.
2011-08-20 14:00:40 -05:00
..
egl android: build core EGL 2011-08-21 02:01:49 +08:00
gallium st/egl: add a missing include 2011-08-21 02:01:50 +08:00
gbm gbm/dri: avoid crash in dri_screen_create 2011-08-04 14:09:34 +02:00
getopt
glsl android: build glsl 2011-08-21 02:01:49 +08:00
glu
glx glx: use a block to fix declarations after code warning 2011-08-19 08:36:22 -06:00
mapi android: build shared glapi 2011-08-21 02:01:49 +08:00
mesa glsl_to_tgsi: implement ir_binop_logic_or using an add w/saturate or add w/SLT 2011-08-20 14:00:40 -05:00
Makefile
SConscript Squashed commit of the following: 2011-07-14 17:35:05 +01:00