summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-03-21 14:44:40 -0700
committerEric Anholt <eric@anholt.net>2008-03-21 14:44:40 -0700
commit84f7780550dde92c7540ee2243b4bce73f73be71 (patch)
tree43cf750d2f9e122171db02c336d6eb325b82f182
parent1a63befcc01d19ff203ff3fd434037ba618bed83 (diff)
Update glean tests to CVS HEAD from 2008-03-21.
-rw-r--r--tests/glean/tglsl1.cpp16
-rw-r--r--tests/glean/tpbo.cpp11
-rw-r--r--tests/glean/tpointatten.cpp5
3 files changed, 23 insertions, 9 deletions
diff --git a/tests/glean/tglsl1.cpp b/tests/glean/tglsl1.cpp
index 397b3dc32..cd792e478 100644
--- a/tests/glean/tglsl1.cpp
+++ b/tests/glean/tglsl1.cpp
@@ -82,7 +82,8 @@ static PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv_func = NULL;
#define FLAG_ILLEGAL_SHADER 0x2 // the shader test should not compile
#define FLAG_ILLEGAL_LINK 0x4 // the shaders should not link
#define FLAG_VERSION_2_1 0x8 // OpenGL 2.1 test (or GLSL 1.20)
-#define FLAG_WINDING_CW 0x10 // clockwise-winding polygon
+#define FLAG_WINDING_CW 0x10 // clockwise-winding polygon
+#define FLAG_VERTEX_TEXTURE 0x20
#define DONT_CARE_Z -1.0
@@ -1706,7 +1707,7 @@ static const ShaderProgram Programs[] = {
NO_FRAGMENT_SHADER,
{ 0.25, 0.0, 0.0, 0.25 },
DONT_CARE_Z,
- FLAG_NONE
+ FLAG_VERTEX_TEXTURE
},
{
@@ -3230,6 +3231,17 @@ GLSLTest::testProgram(const ShaderProgram &p)
glUseProgram_func(program);
+ if (p.flags & FLAG_VERTEX_TEXTURE) {
+ // check if vertex texture units are available
+ GLint n;
+ glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &n);
+ if (n == 0) {
+ // can't run the test
+ retVal = true;
+ goto cleanup;
+ }
+ }
+
// load uniform vars
u1 = glGetUniformLocation_func(program, "uniform1");
if (u1 >= 0)
diff --git a/tests/glean/tpbo.cpp b/tests/glean/tpbo.cpp
index ba24bde17..4642690df 100644
--- a/tests/glean/tpbo.cpp
+++ b/tests/glean/tpbo.cpp
@@ -480,8 +480,10 @@ bool PBOTest::testBitmap(void)
if (usePackBuffer) {
glGenBuffersARB(1, pb_pack);
glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, pb_pack[0]);
- glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT, TEXSIZE * TEXSIZE, NULL,
- GL_STREAM_DRAW);
+ glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT,
+ windowSize * windowSize * 4 * sizeof(GLfloat),
+ NULL,
+ GL_STREAM_DRAW);
glReadPixels(0, 0, windowSize, windowSize, GL_RGB, GL_FLOAT,
NULL);
pboPackMem =
@@ -1030,7 +1032,7 @@ bool PBOTest::testErrorHandling(void)
glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, 0);
if (usePBO) {
- //handle exceed memory size
+ /* test that glDrawPixels from too small of buffer raises error */
glGenBuffersARB(1, fbs);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, fbs[0]);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, 32 * 32 * 4, NULL,
@@ -1042,6 +1044,7 @@ bool PBOTest::testErrorHandling(void)
glDeleteBuffersARB(1, fbs);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, 0);
+ /* test that glReadPixels into too small of buffer raises error */
glGenBuffersARB(1, fbs);
glBindBufferARB(GL_PIXEL_PACK_BUFFER, fbs[0]);
glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT, 32 * 32 * 4, NULL,
@@ -1122,7 +1125,7 @@ bool PBOTest::testPerformance(MultiTestResult & r)
}
glGenTextures(1, textures);
glBindTexture(GL_TEXTURE_2D, textures[0]);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA, TEXSIZE1,
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEXSIZE1,
TEXSIZE1, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
diff --git a/tests/glean/tpointatten.cpp b/tests/glean/tpointatten.cpp
index 086f8974f..f5ce13e8f 100644
--- a/tests/glean/tpointatten.cpp
+++ b/tests/glean/tpointatten.cpp
@@ -151,9 +151,8 @@ bool
PointAttenuationTest::testPointRendering(GLboolean smooth)
{
// epsilon is the allowed size difference in pixels between the
- // expected and actual rendering. We should use something tighter
- // than 1.2 but 1.2 allows NVIDIA's driver to pass.
- const GLfloat epsilon = 1.2;
+ // expected and actual rendering.
+ const GLfloat epsilon = smooth ? 1.5 : 1.0;
GLfloat atten[3];
int count = 0;