summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-04-01 20:13:40 +0100
committerJosé Fonseca <[email protected]>2011-04-01 20:18:22 +0100
commit6586a3b287ad2799addd392d92c56c7f83e22e8f (patch)
treeef4f930fcadd640e95aac8d9b1f8d6e5534da1de
parent3f68d4b0583bd51b18eba6eb1e4be58f37c61778 (diff)
tests: Use elts in translate_test.
-rw-r--r--src/gallium/tests/unit/translate_test.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/gallium/tests/unit/translate_test.c b/src/gallium/tests/unit/translate_test.c
index d0946a91a26..2976fb79227 100644
--- a/src/gallium/tests/unit/translate_test.c
+++ b/src/gallium/tests/unit/translate_test.c
@@ -57,6 +57,7 @@ int main(int argc, char** argv)
unsigned char* byte_buffer;
float* float_buffer;
double* double_buffer;
+ unsigned * elts;
unsigned count = 4;
unsigned i, j, k;
unsigned passed = 0;
@@ -137,6 +138,8 @@ int main(int argc, char** argv)
float_buffer = align_malloc(buffer_size, 4096);
double_buffer = align_malloc(buffer_size, 4096);
+ elts = align_malloc(count * sizeof *elts, 4096);
+
key.nr_elements = 1;
key.element[0].input_buffer = 0;
key.element[0].input_offset = 0;
@@ -156,6 +159,9 @@ int main(int argc, char** argv)
for (i = 0; i < buffer_size / sizeof(double); ++i)
double_buffer[i] = rand_double();
+ for (i = 0; i < count; ++i)
+ elts[i] = i;
+
for (output_format = 1; output_format < PIPE_FORMAT_COUNT; ++output_format)
{
const struct util_format_description* output_format_desc = util_format_description(output_format);
@@ -245,14 +251,14 @@ int main(int argc, char** argv)
else
buffer[0] = byte_buffer;
- translate[0]->set_buffer(translate[0], 0, buffer[0], input_format_size, ~0);
- translate[0]->run(translate[0], 0, count, 0, buffer[1]);
- translate[1]->set_buffer(translate[1], 0, buffer[1], output_format_size, ~0);
- translate[1]->run(translate[1], 0, count, 0, buffer[2]);
- translate[0]->set_buffer(translate[0], 0, buffer[2], input_format_size, ~0);
- translate[0]->run(translate[0], 0, count, 0, buffer[3]);
- translate[1]->set_buffer(translate[1], 0, buffer[3], output_format_size, ~0);
- translate[1]->run(translate[1], 0, count, 0, buffer[4]);
+ translate[0]->set_buffer(translate[0], 0, buffer[0], input_format_size, count - 1);
+ translate[0]->run_elts(translate[0], elts, count, 0, buffer[1]);
+ translate[1]->set_buffer(translate[1], 0, buffer[1], output_format_size, count - 1);
+ translate[1]->run_elts(translate[1], elts, count, 0, buffer[2]);
+ translate[0]->set_buffer(translate[0], 0, buffer[2], input_format_size, count - 1);
+ translate[0]->run_elts(translate[0], elts, count, 0, buffer[3]);
+ translate[1]->set_buffer(translate[1], 0, buffer[3], output_format_size, count - 1);
+ translate[1]->run_elts(translate[1], elts, count, 0, buffer[4]);
for (i = 0; i < count; ++i)
{