summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-09-24 10:14:42 +0200
committerAxel Davy <[email protected]>2016-10-10 23:43:50 +0200
commitcde74cba71cde351f55efa2581e0f2c86e47f7d1 (patch)
tree3ea51724550bcf778a9c49b20b1037fde01f67d7
parent5d2a8e8a367b397466d191f47e766ee3540a6ea6 (diff)
st/nine: Small simplification for position_t and fog
position_t disables fog computation. Signed-off-by: Axel Davy <[email protected]>
-rw-r--r--src/gallium/state_trackers/nine/nine_ff.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c
index 7b3c67c30a3..40717f19510 100644
--- a/src/gallium/state_trackers/nine/nine_ff.c
+++ b/src/gallium/state_trackers/nine/nine_ff.c
@@ -919,9 +919,6 @@ nine_ff_build_vs(struct NineDevice9 *device, struct vs_build_ctx *vs)
struct ureg_dst tmp = ureg_DECL_temporary(ureg);
struct ureg_dst tmp_x = ureg_writemask(tmp, TGSI_WRITEMASK_X);
struct ureg_dst tmp_z = ureg_writemask(tmp, TGSI_WRITEMASK_Z);
- if (key->position_t) {
- ureg_MOV(ureg, ureg_saturate(tmp_x), ureg_scalar(vs->aCol[1], TGSI_SWIZZLE_W));
- } else
if (key->fog_range) {
ureg_DP3(ureg, tmp_x, vs->aVtx, vs->aVtx);
ureg_RSQ(ureg, tmp_z, _X(tmp));
@@ -941,7 +938,7 @@ nine_ff_build_vs(struct NineDevice9 *device, struct vs_build_ctx *vs)
ureg_MUL(ureg, tmp_x, _X(tmp), ureg_imm1f(ureg, -1.442695f));
ureg_EX2(ureg, tmp_x, _X(tmp));
} else
- if (key->fog_mode == D3DFOG_LINEAR && !key->position_t) {
+ if (key->fog_mode == D3DFOG_LINEAR) {
ureg_SUB(ureg, tmp_x, _XXXX(_CONST(28)), _Z(tmp));
ureg_MUL(ureg, ureg_saturate(tmp_x), _X(tmp), _YYYY(_CONST(28)));
}
@@ -1573,9 +1570,9 @@ nine_ff_get_vs(struct NineDevice9 *device)
key.mtl_emissive = state->rs[D3DRS_EMISSIVEMATERIALSOURCE];
}
key.fog = !!state->rs[D3DRS_FOGENABLE];
- key.fog_mode = state->rs[D3DRS_FOGENABLE] ? state->rs[D3DRS_FOGVERTEXMODE] : 0;
+ key.fog_mode = (!key.position_t && state->rs[D3DRS_FOGENABLE]) ? state->rs[D3DRS_FOGVERTEXMODE] : 0;
if (key.fog_mode)
- key.fog_range = !key.position_t && state->rs[D3DRS_RANGEFOGENABLE];
+ key.fog_range = state->rs[D3DRS_RANGEFOGENABLE];
key.localviewer = !!state->rs[D3DRS_LOCALVIEWER];
key.specular_enable = !!state->rs[D3DRS_SPECULARENABLE];