From 54dac2c84310536cce962101de29546d3eb80175 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Fri, 9 Feb 2007 00:36:40 +0100 Subject: optimize generated vertex programs a bit Use new internal state to avoid per-vertex normalization of static spot direction vector. Use internal state for simpler per-vertex fog computations (MAD instead of SUB/MUL for linear fog, EX2 instead of POW for EXP/EXP2 fog). Simplify point size calc (2 MADs instead of MOV, MUL, MUL, DP3), and while there fix it up (RSQ instead of RCP). All untested... --- src/mesa/shader/program.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/shader/program.h') diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h index af06c03598..a0bde07762 100644 --- a/src/mesa/shader/program.h +++ b/src/mesa/shader/program.h @@ -190,6 +190,8 @@ enum state_index { STATE_NORMAL_SCALE, STATE_TEXRECT_SCALE, STATE_POSITION_NORMALIZED, /* normalized light position */ + STATE_FOG_PARAMS_OPTIMIZED, /* for faster fog calc */ + STATE_SPOT_DIR_NORMALIZED, /* pre-normalized spot dir */ STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ }; -- cgit v1.2.3