diff options
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r-- | src/mesa/drivers/glide/fxdd.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxdrv.h | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 0f1ace3ee0..306e0be3b9 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -63,6 +63,9 @@ #include "tnl/t_pipeline.h" + +float gl_ubyte_to_float_255_color_tab[256]; + /* These lookup table are used to extract RGB values in [0,255] from * 16-bit pixel values. */ @@ -667,8 +670,13 @@ static const struct gl_pipeline_stage *fx_pipeline[] = { int fxDDInitFxMesaContext( fxMesaContext fxMesa ) { + int i; static int firsttime = 1; + for (i = 0 ; i < 256 ; i++) { + gl_ubyte_to_float_255_color_tab[i] = (float) i; + } + if (firsttime) { fxDDSetupInit(); fxDDTrifuncInit(); diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index 2f62133221..3e3147e363 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -87,6 +87,16 @@ #define T1COORD GR_VERTEX_TOW_TMU1_OFFSET +extern float gl_ubyte_to_float_255_color_tab[256]; +#define UBYTE_COLOR_TO_FLOAT_255_COLOR(c) gl_ubyte_to_float_255_color_tab[c] +#define UBYTE_COLOR_TO_FLOAT_255_COLOR2(f,c) \ + (*(int *)&(f)) = ((int *)gl_ubyte_to_float_255_color_tab)[c] + + +#define LINTERP(T, A, B) ((A) + (T) * ((B) - (A))) + + + /* Should have size == 16 * sizeof(float). */ typedef union { |