diff options
author | Keith Whitwell <[email protected]> | 2010-03-13 15:06:35 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2010-03-13 15:06:35 +0000 |
commit | 47bfbd452c93e6a8db013fb90d9f42210cf24889 (patch) | |
tree | e3cebba97261f567f461769d891aa77707b57bd7 /src/gallium/drivers/svga | |
parent | faa14818856e1e9a4ee624c2bc04d7aecabd07ab (diff) | |
parent | a80e33f40731f07e8a39896bfdcd1b1504aedc1f (diff) |
Merge commit 'origin/master' into gallium-sampler-view
Conflicts:
src/gallium/auxiliary/util/u_tile.c
src/gallium/auxiliary/util/u_tile.h
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_setup.h
src/gallium/drivers/softpipe/sp_tex_tile_cache.c
src/gallium/include/pipe/p_context.h
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_drawpixels.c
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_context.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_screen_texture.c | 50 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_screen_texture.h | 3 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svgadump/svga_shader_dump.c | 4 |
4 files changed, 41 insertions, 18 deletions
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index d499ae6acc9..adb7840182b 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -164,6 +164,8 @@ struct pipe_context *svga_context_create( struct pipe_screen *screen, svga_init_constbuffer_functions(svga); svga_init_query_functions(svga); + svga_init_texture_functions(&svga->pipe); + /* debug */ svga->debug.no_swtnl = debug_get_bool_option("SVGA_NO_SWTNL", FALSE); svga->debug.force_swtnl = debug_get_bool_option("SVGA_FORCE_SWTNL", FALSE); diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index 5b581debfc7..107e4a39620 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -783,15 +783,17 @@ svga_surface_needs_propagation(struct pipe_surface *surf) return s->dirty && s->handle != tex->handle; } - +/* XXX: Still implementing this as if it was a screen function, but + * can now modify it to queue transfers on the context. + */ static struct pipe_transfer * -svga_get_tex_transfer(struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned face, unsigned level, unsigned zslice, - enum pipe_transfer_usage usage, unsigned x, unsigned y, - unsigned w, unsigned h) +svga_get_tex_transfer(struct pipe_context *pipe, + struct pipe_texture *texture, + unsigned face, unsigned level, unsigned zslice, + enum pipe_transfer_usage usage, unsigned x, unsigned y, + unsigned w, unsigned h) { - struct svga_screen *ss = svga_screen(screen); + struct svga_screen *ss = svga_screen(pipe->screen); struct svga_winsys_screen *sws = ss->sws; struct svga_transfer *st; unsigned nblocksx = util_format_get_nblocksx(texture->format, w); @@ -859,11 +861,14 @@ no_hwbuf: } +/* XXX: Still implementing this as if it was a screen function, but + * can now modify it to queue transfers on the context. + */ static void * -svga_transfer_map( struct pipe_screen *screen, +svga_transfer_map( struct pipe_context *pipe, struct pipe_transfer *transfer ) { - struct svga_screen *ss = svga_screen(screen); + struct svga_screen *ss = svga_screen(pipe->screen); struct svga_winsys_screen *sws = ss->sws; struct svga_transfer *st = svga_transfer(transfer); @@ -877,11 +882,14 @@ svga_transfer_map( struct pipe_screen *screen, } +/* XXX: Still implementing this as if it was a screen function, but + * can now modify it to queue transfers on the context. + */ static void -svga_transfer_unmap(struct pipe_screen *screen, +svga_transfer_unmap(struct pipe_context *pipe, struct pipe_transfer *transfer) { - struct svga_screen *ss = svga_screen(screen); + struct svga_screen *ss = svga_screen(pipe->screen); struct svga_winsys_screen *sws = ss->sws; struct svga_transfer *st = svga_transfer(transfer); @@ -891,10 +899,11 @@ svga_transfer_unmap(struct pipe_screen *screen, static void -svga_tex_transfer_destroy(struct pipe_transfer *transfer) +svga_tex_transfer_destroy(struct pipe_context *pipe, + struct pipe_transfer *transfer) { struct svga_texture *tex = svga_texture(transfer->texture); - struct svga_screen *ss = svga_screen(transfer->texture->screen); + struct svga_screen *ss = svga_screen(pipe->screen); struct svga_winsys_screen *sws = ss->sws; struct svga_transfer *st = svga_transfer(transfer); @@ -911,6 +920,17 @@ svga_tex_transfer_destroy(struct pipe_transfer *transfer) FREE(st); } + +void +svga_init_texture_functions(struct pipe_context *pipe) +{ + pipe->get_tex_transfer = svga_get_tex_transfer; + pipe->transfer_map = svga_transfer_map; + pipe->transfer_unmap = svga_transfer_unmap; + pipe->tex_transfer_destroy = svga_tex_transfer_destroy; +} + + void svga_screen_init_texture_functions(struct pipe_screen *screen) { @@ -920,10 +940,6 @@ svga_screen_init_texture_functions(struct pipe_screen *screen) screen->texture_destroy = svga_texture_destroy; screen->get_tex_surface = svga_get_tex_surface; screen->tex_surface_destroy = svga_tex_surface_destroy; - screen->get_tex_transfer = svga_get_tex_transfer; - screen->transfer_map = svga_transfer_map; - screen->transfer_unmap = svga_transfer_unmap; - screen->tex_transfer_destroy = svga_tex_transfer_destroy; } /*********************************************************************** diff --git a/src/gallium/drivers/svga/svga_screen_texture.h b/src/gallium/drivers/svga/svga_screen_texture.h index ca6602b4369..96d035b12d8 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.h +++ b/src/gallium/drivers/svga/svga_screen_texture.h @@ -186,6 +186,9 @@ svga_surface_needs_propagation(struct pipe_surface *surf); extern void svga_screen_init_texture_functions(struct pipe_screen *screen); +void +svga_init_texture_functions(struct pipe_context *pipe); + enum SVGA3dSurfaceFormat svga_translate_format(enum pipe_format format); diff --git a/src/gallium/drivers/svga/svgadump/svga_shader_dump.c b/src/gallium/drivers/svga/svgadump/svga_shader_dump.c index 705ca29e8f5..4ee1bf2c353 100644 --- a/src/gallium/drivers/svga/svgadump/svga_shader_dump.c +++ b/src/gallium/drivers/svga/svgadump/svga_shader_dump.c @@ -360,7 +360,9 @@ dump_dstreg(struct sh_dstreg dstreg, union { struct sh_reg reg; struct sh_dstreg dstreg; - } u = { { 0 } }; + } u; + + memset(&u, 0, sizeof(u)); assert( (dstreg.modifier & (SVGA3DDSTMOD_SATURATE | SVGA3DDSTMOD_PARTIALPRECISION)) == dstreg.modifier ); |