summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_vs_aos.h
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-05-24 16:31:11 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-05-24 16:31:11 +0100
commit86e529ad90411d21bca3d70984b2db202e7a0cd6 (patch)
tree6485b0c83947ab83c76bea5b636de97fb23a02dd /src/gallium/auxiliary/draw/draw_vs_aos.h
parente1590abb17f1effd92c136207f363de6cf52df18 (diff)
draw: use lookup tables to avoid calling pow() in LIT opcode
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs_aos.h')
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_aos.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.h b/src/gallium/auxiliary/draw/draw_vs_aos.h
index a0680ec63d..c08c73d4bc 100644
--- a/src/gallium/auxiliary/draw/draw_vs_aos.h
+++ b/src/gallium/auxiliary/draw/draw_vs_aos.h
@@ -59,6 +59,25 @@ struct x86_function;
#define FPU_RND_NEG 1
#define FPU_RND_NEAREST 2
+struct aos_machine;
+typedef void PIPE_CDECL (*lit_func)( struct aos_machine *,
+ float *result,
+ const float *in,
+ unsigned count );
+struct shine_tab {
+ float exponent;
+ float values[258];
+ unsigned last_used;
+};
+
+struct lit_info {
+ lit_func func;
+ struct shine_tab *shine_tab;
+};
+
+#define MAX_SHINE_TAB 4
+#define MAX_LIT_INFO 16
+
/* This is the temporary storage used by all the aos_sse vs varients.
* Create one per context and reuse by passing a pointer in at
* vs_varient creation??
@@ -74,6 +93,13 @@ struct aos_machine {
float scale[4]; /* viewport */
float translate[4]; /* viewport */
+ float tmp[2][4]; /* scratch space for LIT */
+
+ struct shine_tab shine_tab[MAX_SHINE_TAB];
+ struct lit_info lit_info[MAX_LIT_INFO];
+ unsigned now;
+
+
ushort fpu_rnd_nearest;
ushort fpu_rnd_neg_inf;
ushort fpu_restore;
@@ -97,6 +123,7 @@ struct aos_compilation {
unsigned insn_counter;
unsigned num_immediates;
unsigned count;
+ unsigned lit_count;
struct {
unsigned idx:16;