[Mesa-stable] [Mesa-dev] [PATCH] glsl: Rewrite and fix min/max to saturate optimization.

Matt Turner mattst88 at gmail.com
Tue Feb 24 12:00:18 PST 2015


On Tue, Feb 24, 2015 at 11:47 AM, Ian Romanick <idr at freedesktop.org> wrote:
> On 02/24/2015 11:22 AM, Matt Turner wrote:
>> There were some bugs, and the code was really difficult to follow. We
>> would optimize
>>
>>    min(max(x, b), 1.0) into max(sat(x), b)
>>
>> but not pay attention to the order of min/max and also do
>>
>>    max(min(x, b), 1.0) into max(sat(x), b)
>>
>> Corrects four shaders from Champions of Regnum that do
>>
>>    min(max(x, 1), 10)
>>
>> Cc: "10.5" <mesa-stable at lists.freedesktop.org>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89180
>
> Based on the bug report, I think this same issue exists in 10.4.
> There's going to be one more 10.4 release, so we should tag this patch
> for 10.4 too.

Good point. In that case I'll send 49e04312 for 10.4 as well.


More information about the mesa-stable mailing list