st/nine: Move assert in NineSurface9_ctor
authorPatrick Rudolph <siro@das-labor.org>
Sun, 11 Sep 2016 09:05:01 +0000 (11:05 +0200)
committerAxel Davy <axel.davy@ens.fr>
Mon, 10 Oct 2016 21:43:50 +0000 (23:43 +0200)
Move assert to function entry.

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

index 4d54309ece39b64e6df85263d917fbb19ba60026..45a37f4cd5156a706f438a463798250d78c0a46f 100644 (file)
@@ -76,6 +76,8 @@ NineSurface9_ctor( struct NineSurface9 *This,
     /* The only way we can have !pContainer is being created
      * from create_zs_or_rt_surface with params 0 0 0 */
     assert(pContainer || (Level == 0 && Layer == 0 && TextureType == 0));
+    /* Make sure no resource is passed for pool systemmem */
+    assert(pDesc->Pool != D3DPOOL_SYSTEMMEM || !pResource);
 
     This->data = (uint8_t *)user_buffer;
 
@@ -135,8 +137,6 @@ NineSurface9_ctor( struct NineSurface9 *This,
             return E_OUTOFMEMORY;
     }
 
-    assert(pDesc->Pool != D3DPOOL_SYSTEMMEM || !pResource);
-
     if (pResource && (pDesc->Usage & D3DUSAGE_DYNAMIC))
         pResource->flags |= NINE_RESOURCE_FLAG_LOCKABLE;