st/nine: Improve return error code in CheckDeviceFormat
authorAxel Davy <davyaxel0@gmail.com>
Mon, 3 Jun 2019 22:37:28 +0000 (00:37 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 15 May 2020 15:43:57 +0000 (15:43 +0000)
This seems suspicious, but is better than what we currently do.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>

src/gallium/frontends/nine/adapter9.c

index 200e538994983e02ffaa4476a012d613e1276ed5..356cbb6e6dc2b79e26ee777e1f96d6c4d094d59b 100644 (file)
@@ -297,7 +297,9 @@ NineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This,
     DBG("Usage=%x RType=%u CheckFormat=%s\n", Usage, RType,
         d3dformat_to_string(CheckFormat));
 
-    user_assert(display_format(AdapterFormat, FALSE), D3DERR_INVALIDCALL);
+    /* Wine tests, but suspicious. Needs more tests. */
+    user_assert(adapter_format(AdapterFormat), D3DERR_INVALIDCALL);
+    user_assert(display_format(AdapterFormat, FALSE), D3DERR_NOTAVAILABLE);
 
     hr = NineAdapter9_GetScreen(This, DeviceType, &screen);
     if (FAILED(hr))