st/nine: Add additional error handling in CheckDeviceMultiSampleType
authorPatrick Rudolph <siro@das-labor.org>
Fri, 30 Sep 2016 14:15:38 +0000 (16:15 +0200)
committerAxel Davy <axel.davy@ens.fr>
Mon, 10 Oct 2016 21:43:51 +0000 (23:43 +0200)
Return one supported quality level in error cases.
Return error on invalid multisample count.

Fixes failing wine tests.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/adapter9.c

index dad5fcbad321a43e265a4aea08d042b9c4e4bd60..fbbc586204afcce8d87f3468e995b518f5054a4d 100644 (file)
@@ -385,6 +385,12 @@ NineAdapter9_CheckDeviceMultiSampleType( struct NineAdapter9 *This,
         d3dformat_to_string(SurfaceFormat), Windowed, MultiSampleType,
         pQualityLevels);
 
+    if (pQualityLevels) {
+        /* In error cases return only 1 quality level supported */
+        *pQualityLevels = 1;
+    }
+    user_assert(MultiSampleType < D3DMULTISAMPLE_16_SAMPLES, D3DERR_INVALIDCALL);
+
     hr = NineAdapter9_GetScreen(This, DeviceType, &screen);
     if (FAILED(hr))
         return hr;