summaryrefslogtreecommitdiff
path: root/tests/texturing
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-08-07 04:50:05 +0200
committerRoland Scheidegger <sroland@vmware.com>2014-08-08 18:36:41 +0200
commit3365ee867444de997d799ee3c970463a8f7fb298 (patch)
treed61b42c84b34cd56f42d9145d346bff1aa12ba4c /tests/texturing
parent3143d765052967e668bd915d72af9411d1cccbf2 (diff)
tex-miplevel-selection: use GL_CLAMP_TO_EDGE instead of GL_REPEAT
GL_REPEAT is not legal for the rectangle targets, and because the test uses sampler objects the default GL_REPEAT value will be used even for rectangle target because unlike texture objects they can't be initialized to the legal CLAMP_TO_EDGE value. According to the spec the texture actually should be treated as incomplete in this case which mesa does not do (and I don't know if anyone bothers enough to fix this) but some drivers (like llvmpipe) might not treat unnormalized coords correctly in this case. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'tests/texturing')
-rw-r--r--tests/texturing/tex-miplevel-selection.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/texturing/tex-miplevel-selection.c b/tests/texturing/tex-miplevel-selection.c
index 11e429260..ef9a066c4 100644
--- a/tests/texturing/tex-miplevel-selection.c
+++ b/tests/texturing/tex-miplevel-selection.c
@@ -981,6 +981,10 @@ piglit_init(int argc, char **argv)
set_sampler_parameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST);
set_sampler_parameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ /* need to set this for rect targets, otherwise default GL_REPEAT
+ * in sampler obj should trigger incomplete tex behavior */
+ set_sampler_parameter(GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ set_sampler_parameter(GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
if (IS_SHADOW(target)) {
glActiveTexture(GL_TEXTURE1);