[Mesa-dev] [PATCH] gallivm: implement fully accurate corner filtering for seamless cube maps

Brian Paul brianp at vmware.com
Fri Oct 25 01:33:43 CEST 2013

On 10/23/2013 11:15 AM, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
> d3d10 requires that cube corners are filtered with accurate weights (that
> is, the weight of the non-existing corner texel should be evenly distributed
> to the other 3 texels). OpenGL does not require this (but recommends it).
> This requires us to use different filtering code, since we need per-texel
> weights which our 2d lerp doesn't (and can't) do. And of course the (now
> per element) weights need to be adjusted too for it to work.
> Invoke the new filtering code whenever there's an edge to keep things simpler,
> as it will work for edges too not just corners but of course it's only needed
> with corners.
> More ugly code for not much gain but at least a hacked up cubemap demo
> shows very nice corners now... Not sure yet if and how this should be
> configurable...
> v2: incorporate feedback from Jose, only use special corner filtering code
> when there's a corner not when there's only an edge (as corner filtering code
> is slower, though a perf difference was only measureable when always
> forcing edge code). Plus some minor style fixes.
> ---
>   src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c |  164 +++++++++++++++++++--
>   1 file changed, 151 insertions(+), 13 deletions(-)

Looks OK to me.

Reviewed-by: Brian Paul <brianp at vmware.com>

More information about the mesa-dev mailing list