diff --git a/tests/texturing/depth-tex-compare.c b/tests/texturing/depth-tex-compare.c index 8117cac..e92a633 100644 --- a/tests/texturing/depth-tex-compare.c +++ b/tests/texturing/depth-tex-compare.c @@ -38,7 +38,7 @@ int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB; int piglit_width = 400; -int piglit_height = 300; +int piglit_height = 400; static GLuint tex; @@ -110,7 +110,15 @@ piglit_display(void) static const GLfloat white[3] = {1.0, 1.0, 1.0}; static const GLfloat black[3] = {0.0, 0.0, 0.0}; static const GLfloat green[3] = {0.0, 1.0, 0.0}; - + static const GLfloat dont_care[3] = {-1, -1.0, -1.0}; + + /* + * The dont_care values indicate places where the interpolated R + * coordinate _should_ be 0.5 but because of implementation difference + * may be a little bit off. + * XXX we may need to add more dont_care cases for other hardware + * as needed. + */ static const struct { GLenum compare; float r0; @@ -128,17 +136,26 @@ piglit_display(void) { GL_LEQUAL, 2.0, 0.0, { - pink, white, pink, - pink, black, pink, - pink, green, pink, + pink, white, dont_care, + pink, black, dont_care, + pink, green, dont_care, + } + }, + /* GL_LEQUAL again, with r0=r1=0.5 */ + { + GL_LEQUAL, 0.5, 0.5, + { + pink, pink, pink, + pink, pink, pink, + pink, pink, pink, } }, { GL_GREATER, 2.0, 0.0, { - white, pink, white, - black, pink, black, - green, pink, green, + white, pink, dont_care, + black, pink, dont_care, + green, pink, dont_care, } }, { @@ -149,6 +166,15 @@ piglit_display(void) green, pink, pink, } }, + /* GL_GEQUAL again, with r0=r1=0.5 */ + { + GL_GEQUAL, 0.5, 0.5, + { + pink, pink, white, + pink, pink, black, + pink, pink, green, + } + }, { GL_ALWAYS, 2.0, 0.0, { @@ -196,7 +222,7 @@ piglit_display(void) glBindTexture(GL_TEXTURE_2D, tex); for (row = 0; row < ARRAY_SIZE(tests); row++) { - const int y = 275 - (35 * row); + const int y = piglit_height - 25 - (35 * row); const GLenum compare = tests[row].compare; for (col = 0; col < 3; col++) { @@ -225,13 +251,18 @@ piglit_display(void) const GLfloat *const color = tests[row].probes[(3 * col) + i]; + if (color[0] == dont_care[0]) + continue; + if (!piglit_probe_pixel_rgb(x + 5 + (i * 5), y + 10, color)) { if (!piglit_automatic) { - printf("compare = %s, mode = %s\n", + printf("compare = %s, mode = %s, r0 = %g, r1 = %g\n", compare_names[compare - GL_NEVER], - mode_names[col]); + mode_names[col], + tests[row].r0, + tests[row].r1); } pass = GL_FALSE; @@ -243,7 +274,7 @@ piglit_display(void) glFinish(); glutSwapBuffers(); - printf(" Left to Right: ALPHA, LUMINANCE, INTENSITY\n Top to Bottom: LESS, LEQUAL, GREATER, GEQUAL, ALWAYS, NEVER, NOTEQUAL, EQUAL\n"); + printf(" Left to Right: ALPHA, LUMINANCE, INTENSITY\n Top to Bottom: LESS, LEQUAL, LEQUAL/0.5, GREATER, GEQUAL, GEQUAL/0.5, ALWAYS, NEVER, NOTEQUAL, EQUAL\n"); return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE; }