[Piglit] [PATCH] gl-3.0/minmax: Pass glGetIntegerv two-value params.

Morgan Armand morgan.devel at gmail.com
Thu Jan 19 13:09:01 PST 2012


Same problem and patch as the one done by Vinson Lee a couple of days ago,
but for the 3.0 version.

Get for GL_MAX_VIEWPORT_DIMS returns two values.

Fixes crash on Windows.

---
 tests/spec/gl-3.0/minmax.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/spec/gl-3.0/minmax.c b/tests/spec/gl-3.0/minmax.c
index d81ddc7..24a4482 100644
--- a/tests/spec/gl-3.0/minmax.c
+++ b/tests/spec/gl-3.0/minmax.c
@@ -60,16 +60,16 @@ max_test_i(GLenum token, GLint max, const char *name)
 static void
 min_test_i(GLenum token, GLint min, const char *name)
 {
-	GLint val;
+	GLint vals[2];

-	glGetIntegerv(token, &val);
+	glGetIntegerv(token, vals);

-	if (val < min) {
+	if (vals[0] < min) {
 		fprintf(stderr, "%-50s %8d %8d (ERROR)\n",
-			name, min, val);
+			name, min, vals[0]);
 		pass = false;
 	} else {
-		printf("%-50s %8d %8d\n", name, min, val);
+		printf("%-50s %8d %8d\n", name, min, vals[0]);
 	}
 }

@@ -119,7 +119,7 @@ static double log2(double x)
 static void
 test_oq_bits()
 {
-	GLint dims;
+	GLint dims[2];
 	GLint minbits, oqbits;

 	/* From the GL 3.0 specification, page 329:
@@ -141,8 +141,8 @@ test_oq_bits()
 	 *      n = min{32, log2(maxViewportWidth ∗ maxViewportHeight * 2}"
 	 */

-	glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &dims);
-	minbits = log2((float)dims * dims * 2);
+	glGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims);
+	minbits = log2((float)dims[0] * dims[0] * 2);
 	if (minbits > 32)
 		minbits = 32;

-- 
1.7.7.1.msysgit.0



More information about the Piglit mailing list