From 0dac59928ef602dc4c5c1df80d700f3ce45c13f0 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 14 Sep 2015 18:26:32 +0100 Subject: texelFetch: Fix the divisors when testing MSAA with > 10 samples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: Marek Olšák --- tests/texturing/shaders/texelFetch.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/texturing/shaders/texelFetch.c b/tests/texturing/shaders/texelFetch.c index bc6cc8fcd..66ee6e8fd 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]; -- cgit v1.2.3