[Piglit] [PATCH 04/20] fbo: Rearrange if tests for GL_DEPTH32F_STENCIL8 behaviour.

Paul Berry stereotype441 at gmail.com
Tue Jun 5 17:03:14 PDT 2012


The tests fbo-clear-formats and fbo-generatemipmap-formats need
special behaviour for GL_DEPTH32F_STENCIL8.  This patch rearranges the
if statements that implement that special behaviour so that they no
longer rely on the fact that GL_DEPTH32F_STENCIL8 is (incorrectly)
categorized as having a base internal format of GL_DEPTH_COMPONENT
rather than GL_DEPTH_STENCIL.  This will allow the incorrect
categorization to be removed in a future patch.
---
 tests/fbo/fbo-clear-formats.c          |   14 ++++++--------
 tests/fbo/fbo-generatemipmap-formats.c |    8 ++++----
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/tests/fbo/fbo-clear-formats.c b/tests/fbo/fbo-clear-formats.c
index 0c300d6..0cbba3f 100644
--- a/tests/fbo/fbo-clear-formats.c
+++ b/tests/fbo/fbo-clear-formats.c
@@ -183,14 +183,12 @@ create_tex(GLenum internalformat, GLenum baseformat)
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_2D, tex);
 
-	if (baseformat == GL_DEPTH_COMPONENT) {
-		if (internalformat == GL_DEPTH32F_STENCIL8) {
-			format = GL_DEPTH_STENCIL;
-			type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
-		} else {
-			format = GL_DEPTH_COMPONENT;
-			type = GL_FLOAT;
-		}
+	if (internalformat == GL_DEPTH32F_STENCIL8) {
+		format = GL_DEPTH_STENCIL;
+		type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
+	} else if (baseformat == GL_DEPTH_COMPONENT) {
+		format = GL_DEPTH_COMPONENT;
+		type = GL_FLOAT;
 	} else if (baseformat == GL_DEPTH_STENCIL) {
 		format = GL_DEPTH_STENCIL_EXT;
 		type = GL_UNSIGNED_INT_24_8_EXT;
diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
index e1f0af0..76d0adf 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -74,12 +74,12 @@ create_tex(GLenum internalformat, GLenum baseformat, GLenum basetype)
 		tex = piglit_depth_texture(GL_TEXTURE_2D, internalformat,
 					   tex_width, tex_height, 1, GL_FALSE);
 		assert(glGetError() == 0);
-		if (baseformat == GL_DEPTH_STENCIL) {
-			format = GL_DEPTH_STENCIL;
-			type = GL_UNSIGNED_INT_24_8;
-		} else if (internalformat == GL_DEPTH32F_STENCIL8) {
+		if (internalformat == GL_DEPTH32F_STENCIL8) {
 			format = GL_DEPTH_STENCIL;
 			type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
+		} else if (baseformat == GL_DEPTH_STENCIL) {
+			format = GL_DEPTH_STENCIL;
+			type = GL_UNSIGNED_INT_24_8;
 		} else if (baseformat == GL_DEPTH_COMPONENT) {
 			format = GL_DEPTH_COMPONENT;
 			type = GL_FLOAT;
-- 
1.7.7.6



More information about the Piglit mailing list