[Mesa-dev] [PATCH 3/4] st/mesa: Clamp min_lod and max_lod to BaseLevel and MaxLevel

Fabian Bieler der.fabe at gmx.net
Wed Mar 30 08:41:46 PDT 2011

The problem ist that if BaseLevel + MinLod is bigger than MaxLevel, min_lod 
becomes bigger than max_lod, so the code below swaps min_lod and max_lod and 
we send a max_lod to the driver that is bigger than MaxLevel.

This could also be fixed by adding a condition like
if (sampler->min_lod > texobj->MaxLevel)
  sampler->min_lod = texobj->MaxLevel;

But clamping is a little bit cleaner imho.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-st-mesa-Clamp-min_lod-and-max_lod-to-BaseLevel-and-M.patch
Type: text/x-diff
Size: 1580 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110330/2ffb6245/attachment-0001.patch>

More information about the mesa-dev mailing list