Skip to content

mesa/main: fix distance attenuation calculation in ffvertex

Charmaine Lee requested to merge charmainel/mesa:fix-dist-attenuation into main

What does this MR do and why?

Distance attenuation is miscalculated when ffvertex is changed to emit NIR directly. The dist parameter to calculate_light_attenuation() is the reciprocal of ||VP|| used in the distance attenuation formula (2.4). So we need to get its reciprocal first before applying it to the distance attenuation formula.

@kusma

Merge request reports