summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2015-09-14 18:26:32 +0100
committerNeil Roberts <neil@linux.intel.com>2015-10-06 11:53:55 +0200
commit0dac59928ef602dc4c5c1df80d700f3ce45c13f0 (patch)
treee2314da0ee6ebb8d44c281be7e39369c99b0b5a8 /tests
parent04aad69af967392243d7bdcd89f91e3728a6aaac (diff)
texelFetch: Fix the divisors when testing MSAA with > 10 samples
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@ijw.co.nz> Cc: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/texturing/shaders/texelFetch.c4
1 files changed, 1 insertions, 3 deletions
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];