Module: Mesa
Branch: master
Commit: 51430c21ffd212d801f129d625f3ae8713372f68
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=51430c21ffd212d801f129d625f3ae8713372f68

Author: Christoph Bumiller <[email protected]>
Date:   Sat Apr 10 19:07:28 2010 +0200

nv50: plug in miptree resource vtbl

---

 src/gallium/drivers/nv50/nv50_buffer.c   |    2 +-
 src/gallium/drivers/nv50/nv50_miptree.c  |    7 ++++++-
 src/gallium/drivers/nv50/nv50_resource.h |    2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_buffer.c 
b/src/gallium/drivers/nv50/nv50_buffer.c
index 094e05e..0bda7f7 100644
--- a/src/gallium/drivers/nv50/nv50_buffer.c
+++ b/src/gallium/drivers/nv50/nv50_buffer.c
@@ -67,7 +67,7 @@ static void nv50_buffer_transfer_unmap( struct pipe_context 
*pipe,
 
 
 
-struct u_resource_vtbl nv50_buffer_vtbl = 
+const struct u_resource_vtbl nv50_buffer_vtbl =
 {
        u_default_resource_get_handle,      /* get_handle */
        nv50_buffer_destroy,                /* resource_destroy */
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c 
b/src/gallium/drivers/nv50/nv50_miptree.c
index 6484f92..b7cd921 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -111,7 +111,7 @@ nv50_miptree_get_handle(struct pipe_screen *pscreen,
 }
 
 
-struct u_resource_vtbl nv50_miptree_vtbl = 
+const struct u_resource_vtbl nv50_miptree_vtbl =
 {
    nv50_miptree_get_handle,          /* get_handle */
    nv50_miptree_destroy,             /* resource_destroy */
@@ -137,7 +137,11 @@ nv50_miptree_create(struct pipe_screen *pscreen, const 
struct pipe_resource *tmp
        uint32_t tile_flags;
        int ret, i, l;
 
+       if (!mt)
+               return NULL;
+
        *pt = *tmp;
+       mt->base.vtbl = &nv50_miptree_vtbl;
        pipe_reference_init(&pt->reference, 1);
        pt->screen = pscreen;
 
@@ -248,6 +252,7 @@ nv50_miptree_from_handle(struct pipe_screen *pscreen,
 
 
        mt->base.base = *template;
+       mt->base.vtbl = &nv50_miptree_vtbl;
        pipe_reference_init(&mt->base.base.reference, 1);
        mt->base.base.screen = pscreen;
        mt->image_nr = 1;
diff --git a/src/gallium/drivers/nv50/nv50_resource.h 
b/src/gallium/drivers/nv50/nv50_resource.h
index 963a110..6cf7662 100644
--- a/src/gallium/drivers/nv50/nv50_resource.h
+++ b/src/gallium/drivers/nv50/nv50_resource.h
@@ -16,7 +16,7 @@ struct nouveau_bo;
  */
 struct nv50_resource {
        struct pipe_resource base;
-       struct u_resource_vtbl *vtbl;
+       const struct u_resource_vtbl *vtbl;
        struct nouveau_bo *bo;
 };
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to