radeonsi: initialize the per-context compiler on demand
[mesa.git] / src / gallium / drivers / r300 / r300_screen_buffer.c
index 737a6f5e4f8593d39fa17b146cda123ff0c625c4..c946cfc8d037475be6956de63ee81c1019910648 100644 (file)
@@ -42,7 +42,7 @@ void r300_upload_index_buffer(struct r300_context *r300,
     *index_buffer = NULL;
 
     u_upload_data(r300->uploader,
-                  0, count * index_size,
+                  0, count * index_size, 4,
                   ptr + (*start * index_size),
                   &index_offset,
                   index_buffer);
@@ -77,7 +77,7 @@ r300_buffer_transfer_map( struct pipe_context *context,
     struct pipe_transfer *transfer;
     uint8_t *map;
 
-    transfer = util_slab_alloc(&r300->pool_transfers);
+    transfer = slab_alloc(&r300->pool_transfers);
     transfer->resource = resource;
     transfer->level = level;
     transfer->usage = usage;
@@ -102,8 +102,9 @@ r300_buffer_transfer_map( struct pipe_context *context,
 
             /* Create a new one in the same pipe_resource. */
             new_buf = r300->rws->buffer_create(r300->rws, rbuf->b.b.width0,
-                                               R300_BUFFER_ALIGNMENT, TRUE,
-                                               rbuf->domain, 0);
+                                               R300_BUFFER_ALIGNMENT,
+                                               rbuf->domain,
+                                               RADEON_FLAG_NO_INTERPROCESS_SHARING);
             if (new_buf) {
                 /* Discard the old buffer. */
                 pb_reference(&rbuf->buf, NULL);
@@ -111,7 +112,7 @@ r300_buffer_transfer_map( struct pipe_context *context,
 
                 /* We changed the buffer, now we need to bind it where the old one was bound. */
                 for (i = 0; i < r300->nr_vertex_buffers; i++) {
-                    if (r300->vertex_buffer[i].buffer == &rbuf->b.b) {
+                    if (r300->vertex_buffer[i].buffer.resource == &rbuf->b.b) {
                         r300->vertex_arrays_dirty = TRUE;
                         break;
                     }
@@ -129,7 +130,7 @@ r300_buffer_transfer_map( struct pipe_context *context,
     map = rws->buffer_map(rbuf->buf, r300->cs, usage);
 
     if (!map) {
-        util_slab_free(&r300->pool_transfers, transfer);
+        slab_free(&r300->pool_transfers, transfer);
         return NULL;
     }
 
@@ -142,7 +143,7 @@ static void r300_buffer_transfer_unmap( struct pipe_context *pipe,
 {
     struct r300_context *r300 = r300_context(pipe);
 
-    util_slab_free(&r300->pool_transfers, transfer);
+    slab_free(&r300->pool_transfers, transfer);
 }
 
 static const struct u_resource_vtbl r300_buffer_vtbl =
@@ -152,7 +153,6 @@ static const struct u_resource_vtbl r300_buffer_vtbl =
    r300_buffer_transfer_map,           /* transfer_map */
    NULL,                               /* transfer_flush_region */
    r300_buffer_transfer_unmap,         /* transfer_unmap */
-   NULL   /* transfer_inline_write */
 };
 
 struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
@@ -183,8 +183,9 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
 
     rbuf->buf =
         r300screen->rws->buffer_create(r300screen->rws, rbuf->b.b.width0,
-                                       R300_BUFFER_ALIGNMENT, TRUE,
-                                       rbuf->domain, 0);
+                                       R300_BUFFER_ALIGNMENT,
+                                       rbuf->domain,
+                                       RADEON_FLAG_NO_INTERPROCESS_SHARING);
     if (!rbuf->buf) {
         FREE(rbuf);
         return NULL;