st/nine: Do not set resource usage for SYSTEMMEM
authorAxel Davy <axel.davy@ens.fr>
Tue, 26 Jan 2016 16:02:53 +0000 (17:02 +0100)
committerAxel Davy <axel.davy@ens.fr>
Fri, 12 Feb 2016 22:26:36 +0000 (23:26 +0100)
We do not create a resource for SYSTEMMEM textures,
thus we do not need to set resource usage.

The only exception is vertexbuffer SYSTEMMEM, since
we do use a pipe resource for them.

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

index f88b75c3dd77017e5c6b827fdd5f2be55f99c18e..ce0f74ceabb359c92b6680c1481539daf9c8e74a 100644 (file)
@@ -116,13 +116,10 @@ NineSurface9_ctor( struct NineSurface9 *This,
             return E_OUTOFMEMORY;
     }
 
-    if (pDesc->Pool == D3DPOOL_SYSTEMMEM) {
-        This->base.info.usage = PIPE_USAGE_STAGING;
-        assert(!pResource);
-    } else {
-        if (pResource && (pDesc->Usage & D3DUSAGE_DYNAMIC))
-            pResource->flags |= NINE_RESOURCE_FLAG_LOCKABLE;
-    }
+    assert(pDesc->Pool != D3DPOOL_SYSTEMMEM || !pResource);
+
+    if (pResource && (pDesc->Usage & D3DUSAGE_DYNAMIC))
+        pResource->flags |= NINE_RESOURCE_FLAG_LOCKABLE;
 
     hr = NineResource9_ctor(&This->base, pParams, pResource, FALSE, D3DRTYPE_SURFACE,
                             pDesc->Pool, pDesc->Usage);
index ada08cea90a3cc02af0ce743de45f31718b2bb28..a11dad41e9ce518e9242dc28618d7bb13d4e4544 100644 (file)
@@ -143,9 +143,6 @@ NineTexture9_ctor( struct NineTexture9 *This,
     if (pSharedHandle)
         info->bind |= PIPE_BIND_SHARED;
 
-    if (Pool == D3DPOOL_SYSTEMMEM)
-        info->usage = PIPE_USAGE_STAGING;
-
     if (pSharedHandle && *pSharedHandle) { /* Pool == D3DPOOL_SYSTEMMEM */
         user_buffer = (void *)*pSharedHandle;
         level_offsets = alloca(sizeof(unsigned) * (info->last_level + 1));
index f6988923caac59467e2f267c739b5277e68d544d..5ef11414f3e00064fa81b7731776eb4cb5e4c4b0 100644 (file)
@@ -116,9 +116,6 @@ NineVolume9_ctor( struct NineVolume9 *This,
     This->layer_stride = util_format_get_2d_size(This->info.format,
                                                  This->stride, pDesc->Height);
 
-    if (pDesc->Pool == D3DPOOL_SYSTEMMEM)
-        This->info.usage = PIPE_USAGE_STAGING;
-
     if (!This->resource) {
         hr = NineVolume9_AllocateData(This);
         if (FAILED(hr))