diff options
author | Axel Davy <[email protected]> | 2016-09-25 12:16:59 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-10-10 23:43:50 +0200 |
commit | 36399f9a7f97692a69157c74bb503dc8cb427fa5 (patch) | |
tree | aa8493029bc8e5b2a9659e06ae4c27bce153a03e /src/gallium | |
parent | eda1e6ece722b1f9f7083e419884ca4f7b025dd2 (diff) |
st/nine: Used normed Vtx for reflectionvector
Fix deduced from the spec.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_ff.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c index c2ce352eb06..2c237f4ed84 100644 --- a/src/gallium/state_trackers/nine/nine_ff.c +++ b/src/gallium/state_trackers/nine/nine_ff.c @@ -651,11 +651,14 @@ nine_ff_build_vs(struct NineDevice9 *device, struct vs_build_ctx *vs) break; case NINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR: tmp.WriteMask = TGSI_WRITEMASK_XYZ; - ureg_DP3(ureg, tmp_x, vs->aVtx, vs->aNrm); + aVtx_normed = ureg_DECL_temporary(ureg); + ureg_normalize3(ureg, aVtx_normed, vs->aVtx); + ureg_DP3(ureg, tmp_x, ureg_src(aVtx_normed), vs->aNrm); ureg_MUL(ureg, tmp, vs->aNrm, _X(tmp)); ureg_ADD(ureg, tmp, ureg_src(tmp), ureg_src(tmp)); - ureg_SUB(ureg, ureg_writemask(input_coord, TGSI_WRITEMASK_XYZ), vs->aVtx, ureg_src(tmp)); + ureg_SUB(ureg, ureg_writemask(input_coord, TGSI_WRITEMASK_XYZ), ureg_src(aVtx_normed), ureg_src(tmp)); ureg_MOV(ureg, ureg_writemask(input_coord, TGSI_WRITEMASK_W), ureg_imm1f(ureg, 1.0f)); + ureg_release_temporary(ureg, aVtx_normed); dim_input = 4; tmp.WriteMask = TGSI_WRITEMASK_XYZW; break; |