gallium: add PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK
[mesa.git] / src / gallium / drivers / nouveau / nvc0 / nvc0_resource.c
index 12b5a025064869b426df63a69bebbddea7b5560b..9bafe3d835db049bdfcd3f55d88ee9ccd7b72eed 100644 (file)
@@ -19,14 +19,16 @@ nvc0_resource_create(struct pipe_screen *screen,
 static struct pipe_resource *
 nvc0_resource_from_handle(struct pipe_screen * screen,
                           const struct pipe_resource *templ,
-                          struct winsys_handle *whandle)
+                          struct winsys_handle *whandle,
+                          unsigned usage)
 {
    if (templ->target == PIPE_BUFFER) {
       return NULL;
    } else {
       struct pipe_resource *res = nv50_miptree_from_handle(screen,
                                                            templ, whandle);
-      nv04_resource(res)->vtbl = &nvc0_miptree_vtbl;
+      if (res)
+         nv04_resource(res)->vtbl = &nvc0_miptree_vtbl;
       return res;
    }
 }
@@ -36,8 +38,6 @@ nvc0_surface_create(struct pipe_context *pipe,
                     struct pipe_resource *pres,
                     const struct pipe_surface *templ)
 {
-   /* surfaces are assumed to be miptrees all over the place. */
-   assert(pres->target != PIPE_BUFFER);
    if (unlikely(pres->target == PIPE_BUFFER))
       return nv50_surface_from_buffer(pipe, pres, templ);
    return nvc0_miptree_surface_new(pipe, pres, templ);
@@ -49,9 +49,11 @@ nvc0_init_resource_functions(struct pipe_context *pcontext)
    pcontext->transfer_map = u_transfer_map_vtbl;
    pcontext->transfer_flush_region = u_transfer_flush_region_vtbl;
    pcontext->transfer_unmap = u_transfer_unmap_vtbl;
-   pcontext->transfer_inline_write = u_transfer_inline_write_vtbl;
+   pcontext->buffer_subdata = u_default_buffer_subdata;
+   pcontext->texture_subdata = u_default_texture_subdata;
    pcontext->create_surface = nvc0_surface_create;
    pcontext->surface_destroy = nv50_surface_destroy;
+   pcontext->invalidate_resource = nv50_invalidate_resource;
 }
 
 void