struct vs_build_ctx bld;
struct nine_ff_vs_key key;
unsigned s, i;
+ char input_texture_coord[8];
assert(sizeof(key) <= sizeof(key.value32));
memset(&key, 0, sizeof(key));
memset(&bld, 0, sizeof(bld));
+ memset(&input_texture_coord, 0, sizeof(input_texture_coord));
bld.key = &key;
key.color1in_one = 0;
else if (usage == NINE_DECLUSAGE_PSIZE)
key.vertexpointsize = 1;
+ else if (usage % NINE_DECLUSAGE_COUNT == NINE_DECLUSAGE_TEXCOORD) {
+ s = usage / NINE_DECLUSAGE_COUNT;
+ if (s < 8)
+ input_texture_coord[s] = 1;
+ else
+ DBG("FF given texture coordinate >= 8. Ignoring\n");
+ }
}
}
if (!key.vertexpointsize)
}
for (s = 0; s < 8; ++s) {
- if (state->ff.tex_stage[s][D3DTSS_COLOROP] == D3DTOP_DISABLE &&
- state->ff.tex_stage[s][D3DTSS_ALPHAOP] == D3DTOP_DISABLE)
- break;
+ unsigned gen = (state->ff.tex_stage[s][D3DTSS_TEXCOORDINDEX] >> 16) + 1;
+ unsigned dim = MIN2(state->ff.tex_stage[s][D3DTSS_TEXTURETRANSFORMFLAGS] & 0x7, 4);
+
+ if (key.position_t && gen > NINED3DTSS_TCI_PASSTHRU)
+ gen = NINED3DTSS_TCI_PASSTHRU;
+
+ if (!input_texture_coord[s] && 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);
- if (!key.position_t) {
- unsigned gen = (state->ff.tex_stage[s][D3DTSS_TEXCOORDINDEX] >> 16) + 1;
- unsigned dim = MIN2(state->ff.tex_stage[s][D3DTSS_TEXTURETRANSFORMFLAGS] & 0x7, 4);
- key.tc_gen |= gen << (s * 3);
- key.tc_dim |= dim << (s * 3);
- } else {
- key.tc_gen |= NINED3DTSS_TCI_PASSTHRU << (s * 3);
- }
+ key.tc_dim |= dim << (s * 3);
}
vs = util_hash_table_get(device->ff.ht_vs, &key);