summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-09-24 23:50:58 +0200
committerAxel Davy <[email protected]>2016-10-10 23:43:50 +0200
commit1fe055338d978cf1cdbe6ca101f20d964069038c (patch)
tree66388202e9d981b009b6ed21d221e6a43772da6c /src/gallium/state_trackers
parentaa69bb684875fb22fa1c4dd5f0da86552ca73ff2 (diff)
st/nine: Disable ff vertex blending if required inputs are missing
This behaviour has been partially tested on windows. Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/nine_ff.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c
index 86e142011c6..11c1aa7220e 100644
--- a/src/gallium/state_trackers/nine/nine_ff.c
+++ b/src/gallium/state_trackers/nine/nine_ff.c
@@ -1537,6 +1537,8 @@ nine_ff_get_vs(struct NineDevice9 *device)
struct vs_build_ctx bld;
struct nine_ff_vs_key key;
unsigned s, i;
+ boolean has_indexes = false;
+ boolean has_weights = false;
char input_texture_coord[8];
assert(sizeof(key) <= sizeof(key.value32));
@@ -1559,7 +1561,13 @@ nine_ff_get_vs(struct NineDevice9 *device)
key.color0in_one = 0;
else if (usage == NINE_DECLUSAGE_i(COLOR, 1))
key.color1in_zero = 0;
- else if (usage == NINE_DECLUSAGE_PSIZE)
+ else if (usage == NINE_DECLUSAGE_i(BLENDINDICES, 0)) {
+ has_indexes = true;
+ key.passthrough |= 1 << usage;
+ } else if (usage == NINE_DECLUSAGE_i(BLENDWEIGHT, 0)) {
+ has_weights = true;
+ key.passthrough |= 1 << usage;
+ } else if (usage == NINE_DECLUSAGE_PSIZE)
key.vertexpointsize = 1;
else if (usage % NINE_DECLUSAGE_COUNT == NINE_DECLUSAGE_TEXCOORD) {
s = usage / NINE_DECLUSAGE_COUNT;
@@ -1600,7 +1608,7 @@ nine_ff_get_vs(struct NineDevice9 *device)
key.normalizenormals = !!state->rs[D3DRS_NORMALIZENORMALS];
if (state->rs[D3DRS_VERTEXBLEND] != D3DVBF_DISABLE) {
- key.vertexblend_indexed = !!state->rs[D3DRS_INDEXEDVERTEXBLENDENABLE];
+ key.vertexblend_indexed = !!state->rs[D3DRS_INDEXEDVERTEXBLENDENABLE] && has_indexes;
switch (state->rs[D3DRS_VERTEXBLEND]) {
case D3DVBF_0WEIGHTS: key.vertexblend = key.vertexblend_indexed; break;
@@ -1612,6 +1620,8 @@ nine_ff_get_vs(struct NineDevice9 *device)
assert(!"invalid D3DVBF");
break;
}
+ if (!has_weights && state->rs[D3DRS_VERTEXBLEND] != D3DVBF_0WEIGHTS)
+ key.vertexblend = 0; /* TODO: if key.vertexblend_indexed, perhaps it should use 1.0 as weight, or revert to D3DVBF_0WEIGHTS */
}
for (s = 0; s < 8; ++s) {