Commit 920a91b1 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Make RandomTransform test less susceptible to numerical error.

The way the translation transform was picked, I was getting z shifts
that were so close that after OpenGL transforms you ended up with the
same depth value, which of course threw off the compositing.  This
change limits the precision used for the Z shift which seems to avoid
really close values but does not seem to encourage the same value
(although that is still a possibility).
parent a10cecbd
......@@ -163,7 +163,7 @@ static int compare_color_buffers(IceTSizeType local_width,
return 1;
static int compare_depth_buffers(IceTSizeType local_width,
......@@ -378,7 +378,7 @@ static void RandomTransformTryStrategy()
if (viewport_width < SCREEN_HEIGHT) {
viewport_offset_y = rand()%(SCREEN_HEIGHT-viewport_height);
glViewport((GLint)viewport_offset_x, (GLint)viewport_offset_y,
(GLsizei)viewport_width, (GLsizei)viewport_height);
/* glViewport(0, 0, local_width, local_height); */
......@@ -515,7 +515,7 @@ static int RandomTransformRun()
glTranslatef(2.0f*rand()/RAND_MAX - 1.0f,
2.0f*rand()/RAND_MAX - 1.0f,
2.0f*rand()/RAND_MAX - 1.0f);
((rand()%19998) - 9999) * 0.0001f);
glRotatef(360.0f*rand()/RAND_MAX, 0.0f, 0.0f,
glScalef((float)(1.0/sqrt(num_proc) - 1.0)*(float)rand()/RAND_MAX + 1.0f,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment