diff options
author | Roland Scheidegger <sroland@tungstengraphics.com> | 2007-02-09 00:36:40 +0100 |
---|---|---|
committer | Roland Scheidegger <sroland@tungstengraphics.com> | 2007-02-09 00:36:40 +0100 |
commit | 54dac2c84310536cce962101de29546d3eb80175 (patch) | |
tree | 79b90717b3361af9e0148279db56551e51b5dbbf /src/mesa/main | |
parent | 6cf892eeb6edd69d4ba77d4ececa21a09ba317c4 (diff) |
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...
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/imports.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index d9885dbeec..0633b3b8bf 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -138,6 +138,14 @@ typedef union { GLfloat f; GLint i; } fi_type; #define M_E (2.7182818284590452354) #endif +#ifndef ONE_DIV_LN2 +#define ONE_DIV_LN2 (1.442695040888963456) +#endif + +#ifndef ONE_DIV_SQRT_LN2 +#define ONE_DIV_SQRT_LN2 (1.201122408786449815) +#endif + #ifndef FLT_MAX_EXP #define FLT_MAX_EXP 128 #endif |