diff options
author | Keith Whitwell <[email protected]> | 2005-05-19 20:25:32 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2005-05-19 20:25:32 +0000 |
commit | 18a74321aa825c355392f98f1563a971871794cc (patch) | |
tree | 3cc06374799fad2a3e582e38ffd5af95359bbf34 /src/mesa/tnl/t_vertex_sse.c | |
parent | c2745ffa49e25aa2ff685ee8538a79baad4de54f (diff) |
Invalidate current fastpath on changes to attribute size or offset within
the vertex.
Use existing facilities to check for sse2 and enable when available.
Turn on SSE/SSE2 codegen for t_vertex.c by default when USE_SSE_ASM is
defined. Disable with "MESA_NO_CODEGEN=t".
Diffstat (limited to 'src/mesa/tnl/t_vertex_sse.c')
-rw-r--r-- | src/mesa/tnl/t_vertex_sse.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index d1a9f786516..d4eefdb6fc9 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -33,12 +33,14 @@ #include "simple_list.h" #include "enums.h" +#if defined(USE_X86_ASM) + #define X 0 #define Y 1 #define Z 2 #define W 3 -#define DISASSEM 1 +#define DISASSEM 0 struct x86_reg { GLuint file:3; @@ -1208,18 +1210,26 @@ static GLboolean build_vertex_emit( struct x86_program *p ) return GL_TRUE; } +#include "x86/common_x86_asm.h" + + void _tnl_generate_sse_emit( GLcontext *ctx ) { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct x86_program p; + struct x86_program p; + + if (!cpu_has_xmm) { + vtx->codegen_emit = NULL; + return; + } memset(&p, 0, sizeof(p)); p.ctx = ctx; p.store = MALLOC(1024); - p.inputs_safe = 1; /* for now */ + p.inputs_safe = 0; /* for now */ p.outputs_safe = 1; /* for now */ - p.have_sse2 = 1; /* testing */ + p.have_sse2 = cpu_has_xmm2; p.identity = make_reg(file_XMM, 6); p.chan0 = make_reg(file_XMM, 7); @@ -1246,3 +1256,12 @@ void _tnl_generate_sse_emit( GLcontext *ctx ) (void)sse2_packsswb; (void)sse2_pshufd; } + +#else + +void _tnl_generate_sse_emit( GLcontext *ctx ) +{ + /* Dummy version for when USE_SSE_ASM not defined */ +} + +#endif |