aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_test_main.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-08-07 09:51:04 +0100
committerJosé Fonseca <[email protected]>2009-08-29 09:21:24 +0100
commitb19cb0080cbc9877993e76f6cbd6bc170d3d2851 (patch)
tree057c2e1a9f10bc264f3058c3af8609ca542973d9 /src/gallium/drivers/llvmpipe/lp_test_main.c
parentd52dce0ffbb165146d7b6812ff5152cbeff29a3a (diff)
llvmpipe: Use same type for reference vectors.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_main.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_main.c b/src/gallium/drivers/llvmpipe/lp_test_main.c
index 2ce3fa1c0b5..34e6bf31fcf 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_main.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_main.c
@@ -178,11 +178,11 @@ random_elem(union lp_type type, void *dst, unsigned index)
assert(index < type.length);
if (type.floating) {
double value = (double)random()/(double)RAND_MAX;
- if(!type.norm)
+ if(!type.norm) {
value += (double)random();
- if(type.sign)
if(random() & 1)
value = -value;
+ }
switch(type.width) {
case 32:
*((float *)dst + index) = (float)value;
@@ -250,7 +250,7 @@ random_vec(union lp_type type, void *dst)
boolean
-compare_vec(union lp_type type, const void *res, const double *ref)
+compare_vec(union lp_type type, const void *res, const void *ref)
{
double eps;
unsigned i;
@@ -276,7 +276,7 @@ compare_vec(union lp_type type, const void *res, const double *ref)
for (i = 0; i < type.length; ++i) {
double res_elem = read_elem(type, res, i);
- double ref_elem = ref[i];
+ double ref_elem = read_elem(type, ref, i);
double delta = fabs(res_elem - ref_elem);
if(delta >= 2.0*eps)
return FALSE;