[Mesa-dev] [PATCH]: global forcing anisotropy
Carl-Philip Haensch
Carl-Philip.Haensch at mailbox.tu-dresden.de
Fri May 20 07:41:57 PDT 2011
Zitat von Michel Dänzer <michel at daenzer.net>:
>> diff --git a/src/mesa/state_tracker/st_atom_sampler.c
>> b/src/mesa/state_tracker/st_atom_sampler.c
>> index 06024ad..0dba553 100644
>> --- a/src/mesa/state_tracker/st_atom_sampler.c
>> +++ b/src/mesa/state_tracker/st_atom_sampler.c
>> @@ -177,8 +177,9 @@ static void convert_sampler(struct st_context *st,
>> sampler->border_color);
>> }
>>
>> - sampler->max_anisotropy = (msamp->MaxAnisotropy == 1.0 ?
>> - 0 : (GLuint) msamp->MaxAnisotropy);
>> + sampler->max_anisotropy = MAX2((msamp->MaxAnisotropy == 1.0 ?
>> + 0 : (GLuint) msamp->MaxAnisotropy),
>> + st->min_anisotropy);
>
> Might be better to write this something like
>
> float max_anisotropy = MAX2(msamp->MaxAnisotropy,
> st->min_anisotropy);
> sampler->max_anisotropy = max_anisotropy == 1.0f ? 0 :
> max_anisotropy;
>
> This way sampler->max_anisotropy will still end up being 0 even if
> st->min_anisotropy is 1.0.
>
>
I attached a patch which introduces the global min_anisotropy.
Asking driconf for it is not implemented because I have to think it
over how to access the context with only having the st_screen.
(this future patch would require the last two ones, so would be nice
if they're discussed and applied)
More information about the mesa-dev
mailing list