summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/translate/translate_sse.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-04-19 18:26:39 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-04-19 18:27:30 +0100
commitb1158a5e0031aa33a71baa7bc14ca2c0fe0dabc4 (patch)
tree61c8698ebd310808ec6cc686293956021690ee22 /src/gallium/auxiliary/translate/translate_sse.c
parentaf523a5bd7828fd554669cf83f18992af967a075 (diff)
translate: don't crash on failure to create sse version
Diffstat (limited to 'src/gallium/auxiliary/translate/translate_sse.c')
-rw-r--r--src/gallium/auxiliary/translate/translate_sse.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/translate/translate_sse.c b/src/gallium/auxiliary/translate/translate_sse.c
index cb8815c173..575852d222 100644
--- a/src/gallium/auxiliary/translate/translate_sse.c
+++ b/src/gallium/auxiliary/translate/translate_sse.c
@@ -145,7 +145,7 @@ static struct x86_reg get_inv_255( struct translate_sse *p )
p->inv_255[0] =
p->inv_255[1] =
p->inv_255[2] =
- p->inv_255[3] = 1.0 / 255.0f;
+ p->inv_255[3] = 1.0f / 255.0f;
sse_movups(p->func, reg,
x86_make_disp(translateESI,
@@ -575,22 +575,21 @@ struct translate *translate_sse2_create( const struct translate_key *key )
if (p == NULL)
goto fail;
- if (!rtasm_cpu_has_sse() || !rtasm_cpu_has_sse2())
- goto fail;
-
-
- p->translate.key = *key;
p->translate.release = translate_sse_release;
p->translate.set_buffer = translate_sse_set_buffer;
p->translate.run_elts = translate_sse_run_elts;
p->translate.run = translate_sse_run;
+ if (!rtasm_cpu_has_sse() || !rtasm_cpu_has_sse2())
+ goto fail;
+
if (!build_vertex_emit(p, &p->linear_func, TRUE))
goto fail;
if (!build_vertex_emit(p, &p->elt_func, FALSE))
goto fail;
+ p->translate.key = *key;
p->gen_run = (run_func)x86_get_func(&p->linear_func);
p->gen_run_elts = (run_elts_func)x86_get_func(&p->elt_func);
@@ -598,7 +597,7 @@ struct translate *translate_sse2_create( const struct translate_key *key )
fail:
if (p)
- p->translate.release( &p->translate );
+ translate_sse_release( &p->translate );
return NULL;
}