X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_state_constants.c;h=97c818cd379dcb1dfa69e8e47b097c42b3f3bf2d;hb=c7f5c9a3dc6350252e73b541bb85ab3ed9e64a9c;hp=6b0e511cec1d51554c35a7445f02a2bf55cbe21c;hpb=a3eb0f718e19653a2ad8e49396c904183be456f3;p=mesa.git diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c index 6b0e511cec1..97c818cd379 100644 --- a/src/gallium/drivers/svga/svga_state_constants.c +++ b/src/gallium/drivers/svga/svga_state_constants.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "svga_context.h" @@ -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.texture[i]; + struct pipe_resource *tex = svga->curr.sampler_views[i]->texture; float data[4]; data[0] = 1.0 / (float)tex->width0;