summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-09-24 22:49:31 +0200
committerAxel Davy <[email protected]>2016-10-10 23:43:50 +0200
commitaa69bb684875fb22fa1c4dd5f0da86552ca73ff2 (patch)
tree985ab3c1b6ea7b43b394ba844e11bebd53ec24c8 /src/gallium/state_trackers
parentab068a78d39815d723b8b2b30dc4477c4ad7fa1a (diff)
st/nine: Use materials if source is not given.
Deduced by test 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.c9
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 4c929206684..86e142011c6 100644
--- a/src/gallium/state_trackers/nine/nine_ff.c
+++ b/src/gallium/state_trackers/nine/nine_ff.c
@@ -1585,10 +1585,11 @@ nine_ff_get_vs(struct NineDevice9 *device)
key.lighting = 0;
}
if ((key.lighting | key.darkness) && state->rs[D3DRS_COLORVERTEX]) {
- key.mtl_diffuse = state->rs[D3DRS_DIFFUSEMATERIALSOURCE];
- key.mtl_ambient = state->rs[D3DRS_AMBIENTMATERIALSOURCE];
- key.mtl_specular = state->rs[D3DRS_SPECULARMATERIALSOURCE];
- key.mtl_emissive = state->rs[D3DRS_EMISSIVEMATERIALSOURCE];
+ uint32_t mask = (key.color0in_one ? 0 : 1) | (key.color1in_zero ? 0 : 2);
+ key.mtl_diffuse = state->rs[D3DRS_DIFFUSEMATERIALSOURCE] & mask;
+ key.mtl_ambient = state->rs[D3DRS_AMBIENTMATERIALSOURCE] & mask;
+ key.mtl_specular = state->rs[D3DRS_SPECULARMATERIALSOURCE] & mask;
+ key.mtl_emissive = state->rs[D3DRS_EMISSIVEMATERIALSOURCE] & mask;
}
key.fog = !!state->rs[D3DRS_FOGENABLE];
key.fog_mode = (!key.position_t && state->rs[D3DRS_FOGENABLE]) ? state->rs[D3DRS_FOGVERTEXMODE] : 0;