Skip to content

llvmpipe: Fix overflow issues calculating loop iterations for aniso

Roland Scheidegger requested to merge sroland/mesa:llvmpipe_aniso_overflow into main

What does this MR do and why?

llvmpipe: Fix overflow issues calculating loop iterations for aniso

iceil can return bogus (negative) values in case there's an overflow
(or a NaN). This would then take forever to run due to a couple billion
loop iterations.
Use unsigned minimum instead which will clamp iterations to max aniso
(not sure if that makes more sense than clamping negative values to 0,
probably doesn't really matter).

Fixes: 350a0fe63298 ("llvmpipe: Use a simpler and faster AF implementation")

Merge request reports

Loading