[Piglit] [PATCH] texelFetch: Fix the divisors when testing MSAA with > 10 samples

Neil Roberts neil at linux.intel.com
Mon Sep 14 10:26:32 PDT 2015


Previously the test was trying to convert a sample number to the range
[0,1] by dividing by 10.0. This doesn't work when testing 16x MSAA
because it ends up with values greater than 1.0 which get clamped.
This patch makes it divide by miplevels so that it will work whatever
the number of samples is.

Cc: Chris Forbes <chrisf at ijw.co.nz>
Cc: Marek Olšák <marek.olsak at amd.com>
---
 tests/texturing/shaders/texelFetch.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/texturing/shaders/texelFetch.c b/tests/texturing/shaders/texelFetch.c
index bc6cc8f..66ee6e8 100644
--- a/tests/texturing/shaders/texelFetch.c
+++ b/tests/texturing/shaders/texelFetch.c
@@ -101,8 +101,6 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 PIGLIT_GL_TEST_CONFIG_END
 
-#define MAX_LOD_OR_SAMPLES  10.0
-
 /** Vertex shader attribute locations */
 const int pos_loc = 0;
 const int texcoord_loc = 1;
@@ -139,7 +137,7 @@ compute_divisors(int lod, float *divisors)
 	divisors[0] = max2(level_size[lod][0] - 1, 1);
 	divisors[1] = max2(level_size[lod][1] - 1, 1);
 	divisors[2] = max2(level_size[lod][2] - 1, 1);
-	divisors[3] = MAX_LOD_OR_SAMPLES;
+	divisors[3] = miplevels;
 
 	if (sampler.data_type != GL_UNSIGNED_INT)
 		divisors[0] = -divisors[0];
-- 
1.9.3



More information about the Piglit mailing list