Skip to content

Commit

Permalink
st/nine: Fix ff has_aNrm computation
Browse files Browse the repository at this point in the history
In some cases the wrong computation led the
normal to be zero instead of the correct value,
which led to artifacts.

Fixes: iXit/wine-nine-standalone#105

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
  • Loading branch information
axeldavy committed Apr 11, 2021
1 parent ab076a8 commit efcc35c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gallium/frontends/nine/nine_ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
*/
Expand Down

0 comments on commit efcc35c

Please sign in to comment.