summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_vs.c12
-rw-r--r--src/mesa/state_tracker/st_cb_program.c14
-rw-r--r--src/mesa/state_tracker/st_program.h6
3 files changed, 31 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom_vs.c b/src/mesa/state_tracker/st_atom_vs.c
index 7420a495206..a326c126089 100644
--- a/src/mesa/state_tracker/st_atom_vs.c
+++ b/src/mesa/state_tracker/st_atom_vs.c
@@ -38,7 +38,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/tgsi/mesa/mesa_to_tgsi.h"
-#include "pipe/tgsi/exec/tgsi_dump.h"
+#include "pipe/tgsi/exec/tgsi_core.h"
#include "st_context.h"
#include "st_atom.h"
@@ -56,6 +56,12 @@ static void compile_vs( struct st_context *st,
if (TGSI_DEBUG)
tgsi_dump( vs->tokens, TGSI_DUMP_VERBOSE );
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ tgsi_emit_sse2(
+ vs->tokens,
+ &vs->sse2_program );
+#endif
}
@@ -121,6 +127,10 @@ static void update_vs( struct st_context *st )
= tgsi_mesa_translate_vertex_output_mask(vp->Base.Base.OutputsWritten);
vs.tokens = &vp->tokens[0];
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ vs.executable = (void *) x86_get_func( &vp->sse2_program );
+#endif
+
if (memcmp(&vs, &st->state.vs, sizeof(vs)) != 0 ||
vp->dirty)
{
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index d0344efa0c3..25da720d865 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -77,6 +77,10 @@ static struct gl_program *st_new_program( GLcontext *ctx,
prog->id = program_id++;
prog->dirty = 1;
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ x86_init_func( &prog->sse2_program );
+#endif
+
return _mesa_init_vertex_program( ctx,
&prog->Base,
target,
@@ -105,6 +109,16 @@ static struct gl_program *st_new_program( GLcontext *ctx,
static void st_delete_program( GLcontext *ctx,
struct gl_program *prog )
{
+ switch( prog->Target ) {
+ case GL_VERTEX_PROGRAM_ARB:
+ {
+ struct st_vertex_program *p = (struct st_vertex_program *) prog;
+
+ x86_release_func( &p->sse2_program );
+ break;
+ }
+
+ }
_mesa_delete_program( ctx, prog );
}
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index e7eb7a8e3f2..883953399cf 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -36,6 +36,7 @@
#include "mtypes.h"
#include "pipe/tgsi/exec/tgsi_token.h"
+#include "x86/rtasm/x86sse.h"
#define ST_FP_MAX_TOKENS 1024
@@ -83,6 +84,11 @@ struct st_vertex_program
struct tgsi_token tokens[ST_FP_MAX_TOKENS];
GLboolean dirty;
+
+#if defined(USE_X86_ASM) || defined(SLANG_X86)
+ struct x86_function sse2_program;
+#endif
+
#if 0
struct pipe_constant_buffer constants;
#endif