diff options
author | Axel Davy <[email protected]> | 2016-11-27 16:23:37 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:44:21 +0100 |
commit | b40f12ebf0288ee66eb8500986c35fbe09da9b56 (patch) | |
tree | dd985ce641972de0d91cfd4c83489b359db5cf6b | |
parent | c75415224fdb7f16f4a6f7ed87dbe62479048a9d (diff) |
st/nine: Fix ff texture coordinate selection
The code was wrongly detecting which texture coordinates
to generate when the coordinate index was different to
the stage index.
Signed-off-by: Axel Davy <[email protected]>
-rw-r--r-- | src/gallium/state_trackers/nine/nine_ff.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c index f30a98886fa..283a3cdf281 100644 --- a/src/gallium/state_trackers/nine/nine_ff.c +++ b/src/gallium/state_trackers/nine/nine_ff.c @@ -1642,21 +1642,22 @@ nine_ff_get_vs(struct NineDevice9 *device) for (s = 0; s < 8; ++s) { unsigned gen = (state->ff.tex_stage[s][D3DTSS_TEXCOORDINDEX] >> 16) + 1; + unsigned idx = state->ff.tex_stage[s][D3DTSS_TEXCOORDINDEX] & 7; unsigned dim; if (key.position_t && gen > NINED3DTSS_TCI_PASSTHRU) gen = NINED3DTSS_TCI_PASSTHRU; - if (!input_texture_coord[s] && gen == NINED3DTSS_TCI_PASSTHRU) + if (!input_texture_coord[idx] && gen == NINED3DTSS_TCI_PASSTHRU) gen = NINED3DTSS_TCI_DISABLE; key.tc_gen |= gen << (s * 3); - key.tc_idx |= (state->ff.tex_stage[s][D3DTSS_TEXCOORDINDEX] & 7) << (s * 3); - key.tc_dim_input |= ((input_texture_coord[s]-1) & 0x3) << (s * 2); + key.tc_idx |= idx << (s * 3); + key.tc_dim_input |= ((input_texture_coord[idx]-1) & 0x3) << (s * 2); dim = state->ff.tex_stage[s][D3DTSS_TEXTURETRANSFORMFLAGS] & 0x7; if (dim > 4) - dim = input_texture_coord[s]; + dim = input_texture_coord[idx]; if (dim == 1) /* NV behaviour */ dim = 0; key.tc_dim_output |= dim << (s * 3); |