svga: Do not shortcut NULL surface relocations with SVGA3D_INVALID_ID.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 15 Aug 2010 12:36:02 +0000 (13:36 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sun, 22 Aug 2010 10:37:28 +0000 (11:37 +0100)
How to cope with NULL surface relocations should be entirely at winsys'
discretion.

src/gallium/drivers/svga/svga_cmd.c
src/gallium/drivers/svga/svga_state_tss.c

index 7b2dfe25496585f26d282d3e43391c8fe97daef2..e975f3b02fa3fcaff2e4fa23ac35236d750dca22 100644 (file)
@@ -67,7 +67,7 @@ void surface_to_surfaceid(struct svga_winsys_context *swc, // IN
       id->mipmap = s->real_level;
    }
    else {
-      id->sid = SVGA3D_INVALID_ID;
+      swc->surface_relocation(swc, &id->sid, NULL, flags);
       id->face = 0;
       id->mipmap = 0;
    }
index 76a2dae14355707a1347f227abae156d67b59497..e42c4f7fce75c95fa974ee2f9b9c5e7d81cbf942 100644 (file)
@@ -128,18 +128,21 @@ update_tss_binding(struct svga_context *svga,
          goto fail;
 
       for (i = 0; i < queue.bind_count; i++) {
+         struct svga_winsys_surface *handle;
+
          ts[i].stage = queue.bind[i].unit;
          ts[i].name = SVGA3D_TS_BIND_TEXTURE;
 
          if (queue.bind[i].view->v) {
-            svga->swc->surface_relocation(svga->swc,
-                                          &ts[i].value,
-                                          queue.bind[i].view->v->handle,
-                                          SVGA_RELOC_READ);
+            handle = queue.bind[i].view->v->handle;
          }
          else {
-            ts[i].value = SVGA3D_INVALID_ID;
+            handle = NULL;
          }
+         svga->swc->surface_relocation(svga->swc,
+                                       &ts[i].value,
+                                       handle,
+                                       SVGA_RELOC_READ);
          
          queue.bind[i].view->dirty = FALSE;
       }