Merge branch '7.8'
[mesa.git] / src / gallium / drivers / svga / svga_state_constants.c
index 493f78a99089e1c87e0c30fa12edd3c115d4cced..97c818cd379dcb1dfa69e8e47b097c42b3f3bf2d 100644 (file)
@@ -82,7 +82,7 @@ static int emit_consts( struct svga_context *svga,
                         int offset,
                         int unit )
 {
-   struct pipe_screen *screen = svga->pipe.screen;
+   struct pipe_transfer *transfer = NULL;
    unsigned count;
    const float (*data)[4] = NULL;
    unsigned i;
@@ -91,11 +91,12 @@ static int emit_consts( struct svga_context *svga,
    if (svga->curr.cb[unit] == NULL)
       goto done;
 
-   count = svga->curr.cb[unit]->size / (4 * sizeof(float));
+   count = svga->curr.cb[unit]->width0 / (4 * sizeof(float));
 
-   data = (const float (*)[4])pipe_buffer_map(screen,
+   data = (const float (*)[4])pipe_buffer_map(&svga->pipe,
                                               svga->curr.cb[unit],
-                                              PIPE_BUFFER_USAGE_CPU_READ);
+                                              PIPE_TRANSFER_READ,
+                                             &transfer);
    if (data == NULL) {
       ret = PIPE_ERROR_OUT_OF_MEMORY;
       goto done;
@@ -109,7 +110,7 @@ static int emit_consts( struct svga_context *svga,
 
 done:
    if (data)
-      pipe_buffer_unmap(screen, svga->curr.cb[unit]);
+      pipe_buffer_unmap(&svga->pipe, svga->curr.cb[unit], transfer);
 
    return ret;
 }
@@ -137,7 +138,7 @@ static int emit_fs_consts( struct svga_context *svga,
 
       for (i = 0; i < key->num_textures; i++) {
          if (key->tex[i].unnormalized) {
-            struct pipe_texture *tex = svga->curr.sampler_views[i]->texture;
+            struct pipe_resource *tex = svga->curr.sampler_views[i]->texture;
             float data[4];
 
             data[0] = 1.0 / (float)tex->width0;