summaryrefslogtreecommitdiffstats
path: root/progs/tests
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-28 21:24:11 -0600
committerBrian Paul <[email protected]>2009-10-28 21:24:11 -0600
commit1f196b786d6bd0c6a5dbdc638574ff716cc3d4de (patch)
tree5ae2753b99070f8b35c51576bd39e52df63879d6 /progs/tests
parent0ea575d721821262a862ceef010db9b1a8b4a6d9 (diff)
parent086f9fc0e2aef27f54eda87c733685500555bf20 (diff)
Merge branch 'texformat-rework'
Conflicts: src/mesa/drivers/dri/radeon/radeon_fbo.c src/mesa/drivers/dri/s3v/s3v_tex.c src/mesa/drivers/dri/s3v/s3v_xmesa.c src/mesa/drivers/dri/trident/trident_context.c src/mesa/main/debug.c src/mesa/main/mipmap.c src/mesa/main/texformat.c src/mesa/main/texgetimage.c
Diffstat (limited to 'progs/tests')
-rw-r--r--progs/tests/packedpixels.c10
-rw-r--r--progs/tests/texcmp.c5
-rw-r--r--progs/tests/texcompsub.c8
-rw-r--r--progs/tests/zreaddraw.c5
4 files changed, 25 insertions, 3 deletions
diff --git a/progs/tests/packedpixels.c b/progs/tests/packedpixels.c
index 1703b271cb0..f4e5d0a7953 100644
--- a/progs/tests/packedpixels.c
+++ b/progs/tests/packedpixels.c
@@ -191,6 +191,16 @@ MakeTexture(const struct pixel_format *format, GLenum intFormat, GLboolean swap)
format->format, format->type, texBuffer);
}
+ if (0) {
+ GLint r, g, b, a;
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &r);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_SIZE, &g);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_SIZE, &b);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &a);
+ printf("sizes: %d %d %d %d\n", r, g, b, a);
+ glGetError();
+ }
+
if (glGetError()) {
printf("GL Error for %s\n", format->name);
memset(texBuffer, 255, 1000);
diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c
index 45935e19a35..3f2cee6e46d 100644
--- a/progs/tests/texcmp.c
+++ b/progs/tests/texcmp.c
@@ -106,6 +106,8 @@ static void Display( void )
glRotatef(Rot, 0, 0, 1);
glEnable(GL_TEXTURE_2D);
+ glEnable(GL_BLEND);
+
glBegin(GL_POLYGON);
glTexCoord2f(0, 1); glVertex2f(-1, -0.5);
glTexCoord2f(1, 1); glVertex2f( 1, -0.5);
@@ -115,7 +117,10 @@ static void Display( void )
glPopMatrix();
+ glDisable(GL_TEXTURE_2D);
+
/* info */
+ glDisable(GL_BLEND);
glColor4f(1, 1, 1, 1);
glRasterPos3f(-1.2, -0.7, 0);
diff --git a/progs/tests/texcompsub.c b/progs/tests/texcompsub.c
index 50106bf1e22..215f5711d95 100644
--- a/progs/tests/texcompsub.c
+++ b/progs/tests/texcompsub.c
@@ -35,6 +35,8 @@ LoadCompressedImage(void)
unsigned char ImgDataTemp[ImgSize / 4];
unsigned i;
const GLenum filter = GL_LINEAR;
+ const int half = ImgSize / 2;
+
glTexImage2D(Target, 0, CompFormat, ImgWidth, ImgHeight, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
@@ -42,11 +44,11 @@ LoadCompressedImage(void)
glCompressedTexSubImage2DARB(Target, 0,
0, 0, /* pos */
ImgWidth, ImgHeight / 2,
- CompFormat, ImgSize / 2, ImgData + ImgSize / 2);
+ CompFormat, ImgSize / 2, ImgData /*+ ImgSize / 2*/);
/* top left */
for (i = 0; i < ImgHeight / 8; i++) {
- memcpy(&ImgDataTemp[i * ImgWidth], &ImgData[i * 2 * ImgWidth], ImgWidth);
+ memcpy(&ImgDataTemp[i * ImgWidth], &ImgData[half + i * 2 * ImgWidth], ImgWidth);
}
glCompressedTexSubImage2DARB(Target, 0,
0, ImgHeight / 2, /* pos */
@@ -55,7 +57,7 @@ LoadCompressedImage(void)
/* top right */
for (i = 0; i < ImgHeight / 8; i++) {
- memcpy(&ImgDataTemp[i * ImgWidth], &ImgData[i * 2 * ImgWidth + ImgWidth], ImgWidth);
+ memcpy(&ImgDataTemp[i * ImgWidth], &ImgData[half + i * 2 * ImgWidth + ImgWidth], ImgWidth);
}
glCompressedTexSubImage2DARB(Target, 0,
ImgWidth / 2, ImgHeight / 2, /* pos */
diff --git a/progs/tests/zreaddraw.c b/progs/tests/zreaddraw.c
index 7dfed20cfb9..7740695bb66 100644
--- a/progs/tests/zreaddraw.c
+++ b/progs/tests/zreaddraw.c
@@ -58,6 +58,10 @@ static void Display(void)
printf("Depth value range: [%f, %f]\n", min, max);
}
+ /* Draw the Z image as luminance above original rendering */
+ glWindowPos2i(0, 100);
+ glDrawPixels(100, 100, GL_LUMINANCE, depthType, depth);
+
if (TestPacking) {
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
@@ -100,6 +104,7 @@ static void Display(void)
glReadPixels(100, 0, 400, 400, GL_DEPTH_COMPONENT, GL_FLOAT, depth2);
/* draw as luminance */
glPixelZoom(1.0, 1.0);
+ glWindowPos2i(100, 0);
glDrawPixels(400, 400, GL_LUMINANCE, GL_FLOAT, depth2);
glutSwapBuffers();