summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_vertex.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-05-19 20:25:32 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-05-19 20:25:32 +0000
commit18a74321aa825c355392f98f1563a971871794cc (patch)
tree3cc06374799fad2a3e582e38ffd5af95359bbf34 /src/mesa/tnl/t_vertex.c
parentc2745ffa49e25aa2ff685ee8538a79baad4de54f (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.c')
-rw-r--r--src/mesa/tnl/t_vertex.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c
index f4847f7578..bed3cf1879 100644
--- a/src/mesa/tnl/t_vertex.c
+++ b/src/mesa/tnl/t_vertex.c
@@ -46,7 +46,9 @@ static GLboolean match_fastpath( struct tnl_clipspace *vtx,
return GL_FALSE;
for (j = 0; j < vtx->attr_count; j++)
- if (vtx->attr[j].format != fp->attr[j].format)
+ if (vtx->attr[j].format != fp->attr[j].format ||
+ vtx->attr[j].inputsize != fp->attr[j].size ||
+ vtx->attr[j].vertoffset != fp->attr[j].offset)
return GL_FALSE;
if (fp->match_strides) {
@@ -90,6 +92,8 @@ void _tnl_register_fastpath( struct tnl_clipspace *vtx,
for (i = 0; i < vtx->attr_count; i++) {
fastpath->attr[i].format = vtx->attr[i].format;
fastpath->attr[i].stride = vtx->attr[i].inputstride;
+ fastpath->attr[i].size = vtx->attr[i].inputsize;
+ fastpath->attr[i].offset = vtx->attr[i].vertoffset;
}
fastpath->next = vtx->fastpath;
@@ -470,8 +474,8 @@ void _tnl_init_vertices( GLcontext *ctx,
vtx->codegen_emit = NULL;
-#ifdef __i386__
- if (getenv("MESA_EXPERIMENTAL"))
+#ifdef USE_SSE_ASM
+ if (!_mesa_getenv("MESA_NO_CODEGEN"))
vtx->codegen_emit = _tnl_generate_sse_emit;
#endif
}