From b8fb1d75ce95fe5d404b301ab31ca0c323967d14 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 10 May 2010 03:27:58 +0200 Subject: r600g: adapt to latest interfaces changes - Wrapped the buffer and texture create/destroy/transfer/... functions using u_resource, which is then used to implement the resource functions. - Implemented texture transfers. I left the buffer and texture transfers separate because one day we'll need a special codepath for textures. - Added index_bias to the draw_*elements functions. - Removed nonexistent *REP and *FOR instructions. - Some pipe formats have changed channel ordering, so I've removed/fixed nonexistent ones. - Added stubs for create/set/destroy sampler views. - Added a naive implementation of vertex elements state (new CSO). - Reworked {texture,buffer}_{from,to}_handle. - Reorganized winsys files, removed dri,egl,python directories. - Added a new build target dri-r600. --- src/gallium/drivers/r600/r600_screen.h | 37 +++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/r600/r600_screen.h') diff --git a/src/gallium/drivers/r600/r600_screen.h b/src/gallium/drivers/r600/r600_screen.h index 97d57c027e..4748021d07 100644 --- a/src/gallium/drivers/r600/r600_screen.h +++ b/src/gallium/drivers/r600/r600_screen.h @@ -29,16 +29,21 @@ #include #include #include "radeon.h" +#include "util/u_transfer.h" #define r600_screen(s) ((struct r600_screen*)s) +/* Texture transfer. */ struct r600_transfer { + /* Base class. */ struct pipe_transfer transfer; + /* Buffer transfer. */ + struct pipe_transfer *buffer_transfer; unsigned offset; }; -struct r600_pipe_buffer { - struct pipe_buffer base; +struct r600_buffer { + struct u_resource b; struct radeon_bo *bo; u32 domain; u32 flink; @@ -50,7 +55,33 @@ struct r600_screen { struct radeon *rw; }; -void r600_screen_init_buffer_functions(struct pipe_screen *screen); +/* Buffer functions. */ +struct pipe_resource *r600_buffer_create(struct pipe_screen *screen, + const struct pipe_resource *templ); +struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen, + void *ptr, unsigned bytes, + unsigned bind); +unsigned r600_buffer_is_referenced_by_cs(struct pipe_context *context, + struct pipe_resource *buf, + unsigned face, unsigned level); +struct pipe_resource *r600_buffer_from_handle(struct pipe_screen *screen, + struct winsys_handle *whandle); + +/* Texture transfer functions. */ +struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, + struct pipe_resource *texture, + struct pipe_subresource sr, + unsigned usage, + const struct pipe_box *box); +void r600_texture_transfer_destroy(struct pipe_context *ctx, + struct pipe_transfer *trans); +void* r600_texture_transfer_map(struct pipe_context *ctx, + struct pipe_transfer* transfer); +void r600_texture_transfer_unmap(struct pipe_context *ctx, + struct pipe_transfer* transfer); + + +/* Blit functions. */ void r600_clear(struct pipe_context *ctx, unsigned buffers, const float *rgba, -- cgit v1.2.3