17 May
2019
17 May
'19
3:45 p.m.
On Fri, 17 May 2019 at 13:22, Paul Gofman <gofmanp(a)gmail.com> wrote:
+static void normalize_vec3(struct wined3d_vec3 *dest, const struct wined3d_vec3 *src) +{ + float rnorm = 1.0f / sqrtf(wined3d_vec3_dot(src, src)); + + *dest = *src; + if (isfinite(rnorm)) + { + dest->x *= rnorm; + dest->y *= rnorm; + dest->z *= rnorm; + } +} I didn't explicitly mention it in my reply to the previous version, but we would want to use the same naming scheme here and for other helpers as well. (So wined3d_vec3_normalise(), wined3d_color_mul_add(), wined3d_vec3_m3x3(), etc.)
Here too, it seems like init_transformed_lights() could reuse most of wined3d_ffp_get_vs_settings().