From efcc35c2c16082e259dd2050ead7a24875ddf680 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Sat, 27 Mar 2021 13:45:17 +0100 Subject: [PATCH] st/nine: Fix ff has_aNrm computation In some cases the wrong computation led the normal to be zero instead of the correct value, which led to artifacts. Fixes: https://github.com/iXit/wine-nine-standalone/issues/105 Signed-off-by: Axel Davy --- src/gallium/frontends/nine/nine_ff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/nine/nine_ff.c b/src/gallium/frontends/nine/nine_ff.c index 8a16270ffe8..56e2f5aa173 100644 --- a/src/gallium/frontends/nine/nine_ff.c +++ b/src/gallium/frontends/nine/nine_ff.c @@ -338,7 +338,7 @@ nine_ff_build_vs(struct NineDevice9 *device, struct vs_build_ctx *vs) unsigned i, c; unsigned label[32], l = 0; boolean need_aNrm = key->lighting || key->passthrough & (1 << NINE_DECLUSAGE_NORMAL); - boolean has_aNrm = need_aNrm && key->has_normal; + boolean has_aNrm; boolean need_aVtx = key->lighting || key->fog_mode || key->pointscale || key->ucp; const unsigned texcoord_sn = get_texcoord_sn(device->screen); @@ -364,6 +364,8 @@ nine_ff_build_vs(struct NineDevice9 *device, struct vs_build_ctx *vs) } } + has_aNrm = need_aNrm && key->has_normal; + /* Declare and record used inputs (needed for linkage with vertex format): * (texture coordinates handled later) */