diff options
Diffstat (limited to 'src/gallium/drivers/i965')
-rw-r--r-- | src/gallium/drivers/i965/brw_pipe_flush.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/i965/brw_pipe_sampler.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/i965/brw_screen.h | 7 | ||||
-rw-r--r-- | src/gallium/drivers/i965/brw_screen_surface.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/i965/brw_screen_texture.c | 34 |
5 files changed, 30 insertions, 19 deletions
diff --git a/src/gallium/drivers/i965/brw_pipe_flush.c b/src/gallium/drivers/i965/brw_pipe_flush.c index fdc4814b22..175c674028 100644 --- a/src/gallium/drivers/i965/brw_pipe_flush.c +++ b/src/gallium/drivers/i965/brw_pipe_flush.c @@ -58,7 +58,7 @@ static unsigned brw_is_buffer_referenced(struct pipe_context *pipe, } static unsigned brw_is_texture_referenced(struct pipe_context *pipe, - struct pipe_texture *texture, + struct pipe_resource *texture, unsigned face, unsigned level) { diff --git a/src/gallium/drivers/i965/brw_pipe_sampler.c b/src/gallium/drivers/i965/brw_pipe_sampler.c index d2aa2bc9f3..1889acc7fd 100644 --- a/src/gallium/drivers/i965/brw_pipe_sampler.c +++ b/src/gallium/drivers/i965/brw_pipe_sampler.c @@ -214,7 +214,7 @@ static void brw_bind_vertex_sampler_state(struct pipe_context *pipe, static struct pipe_sampler_view * brw_create_sampler_view(struct pipe_context *pipe, - struct pipe_texture *texture, + struct pipe_resource *texture, const struct pipe_sampler_view *templ) { struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view); @@ -223,7 +223,7 @@ brw_create_sampler_view(struct pipe_context *pipe, *view = *templ; view->reference.count = 1; view->texture = NULL; - pipe_texture_reference(&view->texture, texture); + pipe_resource_reference(&view->texture, texture); view->context = pipe; } diff --git a/src/gallium/drivers/i965/brw_screen.h b/src/gallium/drivers/i965/brw_screen.h index e3a7c64d48..84199a5ed7 100644 --- a/src/gallium/drivers/i965/brw_screen.h +++ b/src/gallium/drivers/i965/brw_screen.h @@ -60,7 +60,7 @@ struct brw_transfer struct brw_buffer { - struct pipe_buffer base; + struct pipe_resource base; /* One of either bo or user_buffer will be non-null, depending on * whether this is a hardware or user buffer. @@ -106,7 +106,7 @@ struct brw_surface struct brw_texture { - struct pipe_texture base; + struct pipe_resource base; struct brw_winsys_buffer *bo; struct brw_surface_state ss; @@ -154,8 +154,9 @@ brw_buffer(struct pipe_buffer *buffer) } static INLINE struct brw_texture * -brw_texture(struct pipe_texture *texture) +brw_texture(struct pipe_resource *texture) { + assert(texture->target != PIPE_BUFFER); return (struct brw_texture *)texture; } diff --git a/src/gallium/drivers/i965/brw_screen_surface.c b/src/gallium/drivers/i965/brw_screen_surface.c index 904df813dd..9cd2421245 100644 --- a/src/gallium/drivers/i965/brw_screen_surface.c +++ b/src/gallium/drivers/i965/brw_screen_surface.c @@ -198,7 +198,7 @@ static struct brw_surface *create_in_place_view( struct brw_screen *brw_screen, /* Get a surface which is view into a texture */ static struct pipe_surface *brw_get_tex_surface(struct pipe_screen *screen, - struct pipe_texture *pt, + struct pipe_resource *pt, unsigned face, unsigned level, unsigned zslice, unsigned usage ) diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index cadcb7cee2..c45c2f5f0d 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -185,8 +185,8 @@ static GLuint translate_tex_format( enum pipe_format pf ) -static struct pipe_texture *brw_texture_create( struct pipe_screen *screen, - const struct pipe_texture *templ ) +static struct pipe_resource *brw_texture_create( struct pipe_screen *screen, + const struct pipe_resource *templ ) { struct brw_screen *bscreen = brw_screen(screen); @@ -305,9 +305,19 @@ fail: return NULL; } -static struct pipe_texture * +static struct pipe_resource *brw_resource_create( struct pipe_screen *screen, + const struct pipe_texture *templ ) +{ + if (templ.target == PIPE_BUFFER) + return brw_buffer_create( screen, templ ); + else + return brw_texture_create( screen, templ ); +} + + +static struct pipe_resource * brw_texture_from_handle(struct pipe_screen *screen, - const struct pipe_texture *templ, + const struct pipe_resource *templ, struct winsys_handle *whandle) { struct brw_screen *bscreen = brw_screen(screen); @@ -406,7 +416,7 @@ fail: static boolean brw_texture_get_handle(struct pipe_screen *screen, - struct pipe_texture *texture, + struct pipe_resource *texture, struct winsys_handle *whandle) { struct brw_screen *bscreen = brw_screen(screen); @@ -420,7 +430,7 @@ brw_texture_get_handle(struct pipe_screen *screen, -static void brw_texture_destroy(struct pipe_texture *pt) +static void brw_texture_destroy(struct pipe_resource *pt) { struct brw_texture *tex = brw_texture(pt); bo_reference(&tex->bo, NULL); @@ -439,7 +449,7 @@ static boolean brw_is_format_supported( struct pipe_screen *screen, boolean brw_is_texture_referenced_by_bo( struct brw_screen *brw_screen, - struct pipe_texture *texture, + struct pipe_resource *texture, unsigned face, unsigned level, struct brw_winsys_buffer *bo ) @@ -481,8 +491,8 @@ boolean brw_is_texture_referenced_by_bo( struct brw_screen *brw_screen, */ static struct pipe_transfer* -brw_get_tex_transfer(struct pipe_context *pipe, - struct pipe_texture *texture, +brw_get_transfer(struct pipe_context *pipe, + struct pipe_resource *texture, unsigned face, unsigned level, unsigned zslice, enum pipe_transfer_usage usage, unsigned x, unsigned y, unsigned w, unsigned h) @@ -553,7 +563,7 @@ brw_transfer_unmap(struct pipe_context *pipe, } static void -brw_tex_transfer_destroy(struct pipe_context *pipe, +brw_transfer_destroy(struct pipe_context *pipe, struct pipe_transfer *trans) { pipe_texture_reference(&trans->texture, NULL); @@ -563,10 +573,10 @@ brw_tex_transfer_destroy(struct pipe_context *pipe, void brw_tex_init( struct brw_context *brw ) { - brw->base.get_tex_transfer = brw_get_tex_transfer; + brw->base.tex_transfer = brw_get_transfer; brw->base.transfer_map = brw_transfer_map; brw->base.transfer_unmap = brw_transfer_unmap; - brw->base.tex_transfer_destroy = brw_tex_transfer_destroy; + brw->base.transfer_destroy = brw_transfer_destroy; } void brw_screen_tex_init( struct brw_screen *brw_screen ) |