st/nine: Ignore MULTISAMPLEMASK when RT is not multisampled
authorAxel Davy <axel.davy@ens.fr>
Sun, 20 Nov 2016 09:55:54 +0000 (10:55 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:21 +0000 (23:44 +0100)
We were ignoring MULTISAMPLEMASK for non-maskable multisample
modes, but we were missing the non-multisampled case.

Fixes a crash in Halo.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/nine_state.c

index 62f2e8e52d4e52d9789d21e764b1887004e26d37..3523748448e103948470465c68e8521415b4d9be 100644 (file)
@@ -1842,8 +1842,8 @@ NineDevice9_SetRenderTarget( struct NineDevice9 *This,
         This->state.changed.group |= NINE_STATE_VIEWPORT | NINE_STATE_SCISSOR | NINE_STATE_MULTISAMPLE;
 
         if (This->state.rt[0] &&
-            (This->state.rt[0]->desc.MultiSampleType == D3DMULTISAMPLE_NONMASKABLE) !=
-            (rt->desc.MultiSampleType == D3DMULTISAMPLE_NONMASKABLE))
+            (This->state.rt[0]->desc.MultiSampleType <= D3DMULTISAMPLE_NONMASKABLE) !=
+            (rt->desc.MultiSampleType <= D3DMULTISAMPLE_NONMASKABLE))
             This->state.changed.group |= NINE_STATE_SAMPLE_MASK;
     }
 
index 503ff5c659d3ce855094f60e73e32f4f56204006..9e2dfc666d336fb47c78af93cd5d7227829dad9b 100644 (file)
@@ -1100,7 +1100,7 @@ nine_update_state(struct NineDevice9 *device)
             pipe->set_blend_color(pipe, &color);
         }
         if (group & NINE_STATE_SAMPLE_MASK) {
-            if (state->rt[0]->desc.MultiSampleType == D3DMULTISAMPLE_NONMASKABLE) {
+            if (state->rt[0]->desc.MultiSampleType <= D3DMULTISAMPLE_NONMASKABLE) {
                 pipe->set_sample_mask(pipe, ~0);
             } else {
                 pipe->set_sample_mask(pipe, state->rs[D3DRS_MULTISAMPLEMASK]);