summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2015-07-27 09:01:22 -0700
committerNanley Chery <nanley.g.chery@intel.com>2015-10-05 16:01:57 -0700
commit93458f8fc0f7bcf5244e1593d3a687e375c82d9b (patch)
treeee1bd505a6e46982fd735409634a00cd828e9c0d
parentec176b3bc5bb231249de981093ff5ca4ee143544 (diff)
texsubimage: use piglit utility block dimension function
Use the piglit utility function for determining format block dimensions instead of using a test-specific function. This requires adding some formats not originally in the piglit-util function. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--tests/texturing/texsubimage.c47
-rw-r--r--tests/util/piglit-util-gl.c2
2 files changed, 4 insertions, 45 deletions
diff --git a/tests/texturing/texsubimage.c b/tests/texturing/texsubimage.c
index 56387c686..c66f93c93 100644
--- a/tests/texturing/texsubimage.c
+++ b/tests/texturing/texsubimage.c
@@ -267,49 +267,6 @@ equal_images(GLenum target,
}
/**
- * Get block size for compressed format.
- * \return GL_TRUE if format is compressed, GL_FALSE otherwise
- * XXX this could be a piglit util function if useful elsewhere.
- */
-static GLboolean
-get_format_block_size(GLenum format, GLuint *bw, GLuint *bh)
-{
- switch (format) {
- case GL_COMPRESSED_RGB_FXT1_3DFX:
- case GL_COMPRESSED_RGBA_FXT1_3DFX:
- *bw = 8;
- *bh = 4;
- return GL_TRUE;
- case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
- case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
- *bw = 4;
- *bh = 4;
- return GL_TRUE;
- case GL_COMPRESSED_RED:
- case GL_COMPRESSED_RED_RGTC1_EXT:
- case GL_COMPRESSED_RG:
- case GL_COMPRESSED_RED_GREEN_RGTC2_EXT:
- *bw = 4;
- *bh = 4;
- return GL_TRUE;
- case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
- case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
- *bw = 4;
- *bh = 4;
- return GL_TRUE;
- default:
- *bw = *bh = 1;
- return GL_FALSE;
- }
-}
-
-/**
* Draw each image of the texture to the framebuffer and then save the
* entire thing to a buffer with glReadPixels().
*/
@@ -402,9 +359,9 @@ test_format(GLenum target, GLenum intFormat)
GLubyte *updated_img, *updated_ref;
GLubyte *testImg;
GLboolean pass = GL_TRUE;
- GLuint bw, bh, wMask, hMask, dMask;
+ GLuint bw, bh, bb, wMask, hMask, dMask;
GLuint pbo = 0;
- get_format_block_size(intFormat, &bw, &bh);
+ piglit_get_compressed_block_size(intFormat, &bw, &bh, &bb);
wMask = ~(bw-1);
hMask = ~(bh-1);
dMask = ~0;
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 1a24067e8..db17b83c7 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -445,6 +445,7 @@ piglit_get_compressed_block_size(GLenum format,
return true;
case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RED:
case GL_COMPRESSED_RED_RGTC1:
case GL_COMPRESSED_SIGNED_RED_RGTC1:
case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
@@ -456,6 +457,7 @@ piglit_get_compressed_block_size(GLenum format,
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ case GL_COMPRESSED_RG:
case GL_COMPRESSED_RG_RGTC2:
case GL_COMPRESSED_SIGNED_RG_RGTC2:
case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT: