OSDN Git Service

st/nine: Allow ColorFill on D3DFMT_NULL surfaces
authorPatrick Rudolph <siro@das-labor.org>
Sat, 5 Dec 2015 13:14:38 +0000 (14:14 +0100)
committerAxel Davy <axel.davy@ens.fr>
Thu, 4 Feb 2016 21:12:17 +0000 (22:12 +0100)
Report success instead of failing as there's no resource for those surfaces.
Fixes a crash in Crysis: Warhead.

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

index 496a6c9..44c6ebd 100644 (file)
@@ -1669,6 +1669,8 @@ NineDevice9_ColorFill( struct NineDevice9 *This,
     user_assert((surf->base.usage & D3DUSAGE_RENDERTARGET) ||
                 NineSurface9_IsOffscreenPlain(surf), D3DERR_INVALIDCALL);
 
+    user_assert(surf->desc.Format != D3DFMT_NULL, D3D_OK);
+
     if (pRect) {
         x = pRect->left;
         y = pRect->top;