<p dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></p>
<div class="gmail_quote">On Mar 23, 2016 3:40 PM, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When using seamless cube map mode and NEAREST filtering, we explicitly<br>
overrode the wrap modes to CLAMP_TO_EDGE.  This was to implement the<br>
following spec text:<br>
<br>
   "If NEAREST filtering is done within a miplevel, always apply apply<br>
    wrap mode CLAMP_TO_EDGE."<br>
<br>
However, textureGather() ignores the sampler's filtering mode, and<br>
instead returns the four pixels that would be blended by LINEAR<br>
filtering.  This implies that we should do proper seamless filtering,<br>
and include pixels from adjacent cube faces.<br>
<br>
It turns out that we can simply delete the NEAREST -> CLAMP_TO_EDGE<br>
overrides.  Normal cube map sampling works by first selecting the<br>
face, and then nearest filtering fetches the closest texel.  If the<br>
nearest texel was on a different face, then that face would have been<br>
chosen.  So it should always be within the face anyway, which<br>
effectively performs CLAMP_TO_EDGE.<br>
<br>
Fixes 86 dEQP-GLES31.texture.gather.basic.cube.* tests.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
 src/mesa/drivers/dri/i965/brw_sampler_state.c | 4 +---<br>
 1 file changed, 1 insertion(+), 3 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c b/src/mesa/drivers/dri/i965/brw_sampler_state.c<br>
index c20a028..3bd22c7 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_sampler_state.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c<br>
@@ -460,9 +460,7 @@ brw_update_sampler_state(struct brw_context *brw,<br>
       /* Cube maps must use the same wrap mode for all three coordinate<br>
        * dimensions.  Prior to Haswell, only CUBE and CLAMP are valid.<br>
        */<br>
-      if ((tex_cube_map_seamless || sampler->CubeMapSeamless) &&<br>
-         (sampler->MinFilter != GL_NEAREST ||<br>
-          sampler->MagFilter != GL_NEAREST)) {<br>
+      if (tex_cube_map_seamless || sampler->CubeMapSeamless) {<br>
         wrap_s = BRW_TEXCOORDMODE_CUBE;<br>
         wrap_t = BRW_TEXCOORDMODE_CUBE;<br>
         wrap_r = BRW_TEXCOORDMODE_CUBE;<br>
--<br>
2.7.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>