[Mesa-dev] [PATCH] i965: Enable EWA anisotropic filtering algorithm

Ian Romanick idr at freedesktop.org
Fri Mar 14 07:49:49 PDT 2014


On 03/13/2014 04:28 PM, Kenneth Graunke wrote:
> On 03/13/2014 03:30 PM, Kenneth Graunke wrote:
>> On 03/04/2014 01:08 AM, Ian Romanick wrote:
>>> From: Ian Romanick <ian.d.romanick at intel.com>
>>>
>>> Volume 4, part 1 of the Ivybridge PRM says, "Generally, the EWA
>>> approximation algorithm results in higher image quality than the legacy
>>> algorithm."  Using a classic anisotropic filtering "tunnel" demo, it
>>> appears that there is *no* anisotropic filtering on IVB without this bit
>>> set.
>>>
>>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>>> Cc: Eero Tamminen <eero.t.tamminen at intel.com>
>>> ---
>>>  src/mesa/drivers/dri/i965/gen7_sampler_state.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/src/mesa/drivers/dri/i965/gen7_sampler_state.c b/src/mesa/drivers/dri/i965/gen7_sampler_state.c
>>> index 968c410..709a783 100644
>>> --- a/src/mesa/drivers/dri/i965/gen7_sampler_state.c
>>> +++ b/src/mesa/drivers/dri/i965/gen7_sampler_state.c
>>> @@ -82,6 +82,7 @@ gen7_update_sampler_state(struct brw_context *brw, int unit, int ss_index,
>>>     if (gl_sampler->MaxAnisotropy > 1.0) {
>>>        sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC;
>>>        sampler->ss0.mag_filter = BRW_MAPFILTER_ANISOTROPIC;
>>> +      sampler->ss0.aniso_algorithm = 1;
>>>  
>>>        if (gl_sampler->MaxAnisotropy > 2.0) {
>>>  	 sampler->ss3.max_aniso = MIN2((gl_sampler->MaxAnisotropy - 2) / 2,
>>
>> *No* anisotropic filtering is a surprising result, but I can confirm
>> that enabling the EWA algorithm significantly changes the rendering in
>> one test I've looked at.  Without it, you get something like a polar
>> rose, and with it, you get a circle (which is the expected result).

I think we were looking at the same test. :)

>> So I think we should go ahead with this.
>>
>> Acked-by: Kenneth Graunke <kenneth at whitecape.org>
> 
> It also seems to be a 37% performance hit in that test, FWIW.

Which seems to support the "no anisotropic filtering" theory.
Anisotropic filtering does a lot of samples per texture look-up, so it
should be slower.

> --Ken



More information about the mesa-dev mailing list