summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-10-03 04:59:20 +0200
committerMarek Olšák <maraeo@gmail.com>2010-10-03 13:45:20 +0200
commitb86362e3ea5140b38a53268e053c59e5cc448156 (patch)
treebbcd64122f4ed1582ea6e691055aa4d3f0652318
parent666542aeb753013aaa3ee375af6797f14d125c9f (diff)
util: extend piglit_rgbw_texture to have a different alpha in each block
This alpha modification is optional. It will be needed for testing fbo-generatemipmap-formats/GL_ALPHA, which currently always passes. This commit does not change behavior of any test (note the GL_FALSE parameter).
-rw-r--r--tests/fbo/fbo-generatemipmap-formats.c3
-rw-r--r--tests/shaders/glsl-vs-texturematrix-1.c2
-rw-r--r--tests/shaders/glsl-vs-texturematrix-2.c2
-rw-r--r--tests/shaders/shader_runner.c2
-rw-r--r--tests/texturing/fxt1-teximage.c4
-rw-r--r--tests/texturing/s3tc-teximage.c8
-rw-r--r--tests/util/piglit-util.c16
-rw-r--r--tests/util/piglit-util.h3
8 files changed, 25 insertions, 15 deletions
diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
index e5a8ebfba..6d3761d3f 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -412,7 +412,8 @@ create_tex(GLenum internalformat)
}
} else {
tex = piglit_rgbw_texture(internalformat,
- TEX_WIDTH, TEX_HEIGHT, GL_FALSE);
+ TEX_WIDTH, TEX_HEIGHT, GL_FALSE,
+ GL_FALSE);
format = GL_RGBA;
type = GL_FLOAT;
}
diff --git a/tests/shaders/glsl-vs-texturematrix-1.c b/tests/shaders/glsl-vs-texturematrix-1.c
index 90e2b7f1b..258e8cf57 100644
--- a/tests/shaders/glsl-vs-texturematrix-1.c
+++ b/tests/shaders/glsl-vs-texturematrix-1.c
@@ -48,7 +48,7 @@ piglit_display(void)
GLuint tex;
glActiveTexture(GL_TEXTURE1);
- tex = piglit_rgbw_texture(GL_RGBA, 8, 8, GL_FALSE);
+ tex = piglit_rgbw_texture(GL_RGBA, 8, 8, GL_FALSE, GL_FALSE);
glEnable(GL_TEXTURE_2D);
glMatrixMode(GL_TEXTURE);
diff --git a/tests/shaders/glsl-vs-texturematrix-2.c b/tests/shaders/glsl-vs-texturematrix-2.c
index a2c393872..62c4f58f5 100644
--- a/tests/shaders/glsl-vs-texturematrix-2.c
+++ b/tests/shaders/glsl-vs-texturematrix-2.c
@@ -50,7 +50,7 @@ piglit_display(void)
GLuint tex;
glActiveTexture(GL_TEXTURE1);
- tex = piglit_rgbw_texture(GL_RGBA, 8, 8, GL_FALSE);
+ tex = piglit_rgbw_texture(GL_RGBA, 8, 8, GL_FALSE, GL_FALSE);
glEnable(GL_TEXTURE_2D);
glMatrixMode(GL_TEXTURE);
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 5e36815d9..4e385c8c2 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -730,7 +730,7 @@ piglit_display(void)
"texture rgbw %d ( %d , %d )",
&tex, &w, &h) == 3) {
glActiveTexture(GL_TEXTURE0 + tex);
- piglit_rgbw_texture(GL_RGBA, w, h, GL_FALSE);
+ piglit_rgbw_texture(GL_RGBA, w, h, GL_FALSE, GL_FALSE);
glEnable(GL_TEXTURE_2D);
} else if (sscanf(line,
"texture checkerboard %d %d ( %d , %d ) "
diff --git a/tests/texturing/fxt1-teximage.c b/tests/texturing/fxt1-teximage.c
index 09097dfed..6487a8a34 100644
--- a/tests/texturing/fxt1-teximage.c
+++ b/tests/texturing/fxt1-teximage.c
@@ -111,11 +111,11 @@ piglit_display(void)
glClear(GL_COLOR_BUFFER_BIT);
tex = piglit_rgbw_texture(GL_COMPRESSED_RGB_FXT1_3DFX, SIZE, SIZE,
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
display_mipmaps(10, 10 + (10 + SIZE) * 0);
glDeleteTextures(1, &tex);
tex = piglit_rgbw_texture(GL_COMPRESSED_RGBA_FXT1_3DFX, SIZE, SIZE,
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
display_mipmaps(10, 10 + (10 + SIZE) * 1);
glDeleteTextures(1, &tex);
diff --git a/tests/texturing/s3tc-teximage.c b/tests/texturing/s3tc-teximage.c
index 5852b92fb..3c4205cf8 100644
--- a/tests/texturing/s3tc-teximage.c
+++ b/tests/texturing/s3tc-teximage.c
@@ -110,19 +110,19 @@ piglit_display(void)
glClear(GL_COLOR_BUFFER_BIT);
tex = piglit_rgbw_texture(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, SIZE, SIZE,
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
display_mipmaps(10, 10 + (10 + SIZE) * 0);
glDeleteTextures(1, &tex);
tex = piglit_rgbw_texture(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, SIZE, SIZE,
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
display_mipmaps(10, 10 + (10 + SIZE) * 1);
glDeleteTextures(1, &tex);
tex = piglit_rgbw_texture(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, SIZE, SIZE,
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
display_mipmaps(10, 10 + (10 + SIZE) * 2);
glDeleteTextures(1, &tex);
tex = piglit_rgbw_texture(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, SIZE, SIZE,
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
display_mipmaps(10, 10 + (10 + SIZE) * 3);
glDeleteTextures(1, &tex);
diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index 33b0b431a..fdc6d629e 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -886,16 +886,24 @@ piglit_checkerboard_texture(GLuint tex, unsigned level,
* green, and w == 1 to blue.
*/
GLuint
-piglit_rgbw_texture(GLenum format, int w, int h, GLboolean mip)
+piglit_rgbw_texture(GLenum format, int w, int h, GLboolean mip,
+ GLboolean alpha)
{
GLfloat *data;
int size, x, y, level;
GLuint tex;
- float red[4] = {1.0, 0.0, 0.0, 1.0};
- float green[4] = {0.0, 1.0, 0.0, 1.0};
- float blue[4] = {0.0, 0.0, 1.0, 1.0};
+ float red[4] = {1.0, 0.0, 0.0, 0.0};
+ float green[4] = {0.0, 1.0, 0.0, 0.25};
+ float blue[4] = {0.0, 0.0, 1.0, 0.5};
float white[4] = {1.0, 1.0, 1.0, 1.0};
+ if (!alpha) {
+ red[3] = 1.0;
+ green[3] = 1.0;
+ blue[3] = 1.0;
+ white[3] = 1.0;
+ }
+
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 0d5e858ce..62551abe4 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -114,7 +114,8 @@ GLuint piglit_checkerboard_texture(GLuint tex, unsigned level,
unsigned width, unsigned height,
unsigned horiz_square_size, unsigned vert_square_size,
const float *black, const float *white);
-GLuint piglit_rgbw_texture(GLenum format, int w, int h, GLboolean mip);
+GLuint piglit_rgbw_texture(GLenum format, int w, int h, GLboolean mip,
+ GLboolean alpha);
GLuint piglit_depth_texture(GLenum format, int w, int h, GLboolean mip);
extern GLfloat cube_face_texcoords[6][4][3];