diff options
Diffstat (limited to 'src/gallium/drivers/rbug')
-rw-r--r-- | src/gallium/drivers/rbug/rbug_context.c | 72 | ||||
-rw-r--r-- | src/gallium/drivers/rbug/rbug_core.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/rbug/rbug_objects.c | 9 | ||||
-rw-r--r-- | src/gallium/drivers/rbug/rbug_objects.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/rbug/rbug_screen.c | 46 |
5 files changed, 68 insertions, 73 deletions
diff --git a/src/gallium/drivers/rbug/rbug_context.c b/src/gallium/drivers/rbug/rbug_context.c index 413da59e559..94e57e40f86 100644 --- a/src/gallium/drivers/rbug/rbug_context.c +++ b/src/gallium/drivers/rbug/rbug_context.c @@ -707,17 +707,13 @@ rbug_set_sample_mask(struct pipe_context *_pipe, static void rbug_resource_copy_region(struct pipe_context *_pipe, struct pipe_resource *_dst, - struct pipe_subresource subdst, + unsigned dst_level, unsigned dstx, unsigned dsty, unsigned dstz, struct pipe_resource *_src, - struct pipe_subresource subsrc, - unsigned srcx, - unsigned srcy, - unsigned srcz, - unsigned width, - unsigned height) + unsigned src_level, + const struct pipe_box *src_box) { struct rbug_context *rb_pipe = rbug_context(_pipe); struct rbug_resource *rb_resource_dst = rbug_resource(_dst); @@ -728,17 +724,13 @@ rbug_resource_copy_region(struct pipe_context *_pipe, pipe->resource_copy_region(pipe, dst, - subdst, + dst_level, dstx, dsty, dstz, src, - subsrc, - srcx, - srcy, - srcz, - width, - height); + src_level, + src_box); } static void @@ -820,8 +812,8 @@ rbug_flush(struct pipe_context *_pipe, static unsigned int rbug_is_resource_referenced(struct pipe_context *_pipe, struct pipe_resource *_resource, - unsigned face, - unsigned level) + unsigned level, + int layer) { struct rbug_context *rb_pipe = rbug_context(_pipe); struct rbug_resource *rb_resource = rbug_resource(_resource); @@ -830,8 +822,8 @@ rbug_is_resource_referenced(struct pipe_context *_pipe, return pipe->is_resource_referenced(pipe, resource, - face, - level); + level, + layer); } static struct pipe_sampler_view * @@ -862,10 +854,40 @@ rbug_context_sampler_view_destroy(struct pipe_context *_pipe, rbug_sampler_view(_view)); } +static struct pipe_surface * +rbug_context_create_surface(struct pipe_context *_pipe, + struct pipe_resource *_resource, + const struct pipe_surface *surf_tmpl) +{ + struct rbug_context *rb_pipe = rbug_context(_pipe); + struct rbug_resource *rb_resource = rbug_resource(_resource); + struct pipe_context *pipe = rb_pipe->pipe; + struct pipe_resource *resource = rb_resource->resource; + struct pipe_surface *result; + + result = pipe->create_surface(pipe, + resource, + surf_tmpl); + + if (result) + return rbug_surface_create(rb_pipe, rb_resource, result); + return NULL; +} + +static void +rbug_context_surface_destroy(struct pipe_context *_pipe, + struct pipe_surface *_surface) +{ + rbug_surface_destroy(rbug_context(_pipe), + rbug_surface(_surface)); +} + + + static struct pipe_transfer * rbug_context_get_transfer(struct pipe_context *_context, struct pipe_resource *_resource, - struct pipe_subresource sr, + unsigned level, unsigned usage, const struct pipe_box *box) { @@ -877,7 +899,7 @@ rbug_context_get_transfer(struct pipe_context *_context, result = context->get_transfer(context, resource, - sr, + level, usage, box); @@ -942,12 +964,12 @@ rbug_context_transfer_unmap(struct pipe_context *_context, static void rbug_context_transfer_inline_write(struct pipe_context *_context, struct pipe_resource *_resource, - struct pipe_subresource sr, + unsigned level, unsigned usage, const struct pipe_box *box, const void *data, unsigned stride, - unsigned slice_stride) + unsigned layer_stride) { struct rbug_context *rb_pipe = rbug_context(_context); struct rbug_resource *rb_resource = rbug_resource(_resource); @@ -956,12 +978,12 @@ rbug_context_transfer_inline_write(struct pipe_context *_context, context->transfer_inline_write(context, resource, - sr, + level, usage, box, data, stride, - slice_stride); + layer_stride); } @@ -1042,6 +1064,8 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) rb_pipe->base.is_resource_referenced = rbug_is_resource_referenced; rb_pipe->base.create_sampler_view = rbug_context_create_sampler_view; rb_pipe->base.sampler_view_destroy = rbug_context_sampler_view_destroy; + rb_pipe->base.create_surface = rbug_context_create_surface; + rb_pipe->base.surface_destroy = rbug_context_surface_destroy; rb_pipe->base.get_transfer = rbug_context_get_transfer; rb_pipe->base.transfer_destroy = rbug_context_transfer_destroy; rb_pipe->base.transfer_map = rbug_context_transfer_map; diff --git a/src/gallium/drivers/rbug/rbug_core.c b/src/gallium/drivers/rbug/rbug_core.c index 9dc663b079a..eb772d19d05 100644 --- a/src/gallium/drivers/rbug/rbug_core.c +++ b/src/gallium/drivers/rbug/rbug_core.c @@ -266,9 +266,9 @@ rbug_texture_read(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_ tex = tr_tex->resource; t = pipe_get_transfer(context, tex, - gptr->face, gptr->level, gptr->zslice, - PIPE_TRANSFER_READ, - gptr->x, gptr->y, gptr->w, gptr->h); + gptr->level, gptr->face + gptr->zslice, + PIPE_TRANSFER_READ, + gptr->x, gptr->y, gptr->w, gptr->h); map = context->transfer_map(context, t); @@ -279,7 +279,7 @@ rbug_texture_read(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_ util_format_get_blocksize(t->resource->format), (uint8_t*)map, t->stride * util_format_get_nblocksy(t->resource->format, - t->box.height), + t->box.height), t->stride, NULL); diff --git a/src/gallium/drivers/rbug/rbug_objects.c b/src/gallium/drivers/rbug/rbug_objects.c index 0979fcff957..7d7cc482ae6 100644 --- a/src/gallium/drivers/rbug/rbug_objects.c +++ b/src/gallium/drivers/rbug/rbug_objects.c @@ -79,7 +79,8 @@ rbug_resource_destroy(struct rbug_resource *rb_resource) struct pipe_surface * -rbug_surface_create(struct rbug_resource *rb_resource, +rbug_surface_create(struct rbug_context *rb_context, + struct rbug_resource *rb_resource, struct pipe_surface *surface) { struct rbug_surface *rb_surface; @@ -108,10 +109,12 @@ error: } void -rbug_surface_destroy(struct rbug_surface *rb_surface) +rbug_surface_destroy(struct rbug_context *rb_context, + struct rbug_surface *rb_surface) { pipe_resource_reference(&rb_surface->base.texture, NULL); - pipe_surface_reference(&rb_surface->surface, NULL); + rb_context->pipe->surface_destroy(rb_context->pipe, + rb_surface->surface); FREE(rb_surface); } diff --git a/src/gallium/drivers/rbug/rbug_objects.h b/src/gallium/drivers/rbug/rbug_objects.h index 49c128d3d1a..3fba3334228 100644 --- a/src/gallium/drivers/rbug/rbug_objects.h +++ b/src/gallium/drivers/rbug/rbug_objects.h @@ -189,11 +189,13 @@ void rbug_resource_destroy(struct rbug_resource *rb_resource); struct pipe_surface * -rbug_surface_create(struct rbug_resource *rb_resource, +rbug_surface_create(struct rbug_context *rb_context, + struct rbug_resource *rb_resource, struct pipe_surface *surface); void -rbug_surface_destroy(struct rbug_surface *rb_surface); +rbug_surface_destroy(struct rbug_context *rb_context, + struct rbug_surface *rb_surface); struct pipe_sampler_view * rbug_sampler_view_create(struct rbug_context *rb_context, diff --git a/src/gallium/drivers/rbug/rbug_screen.c b/src/gallium/drivers/rbug/rbug_screen.c index 961df482c29..d635ce575c0 100644 --- a/src/gallium/drivers/rbug/rbug_screen.c +++ b/src/gallium/drivers/rbug/rbug_screen.c @@ -188,40 +188,6 @@ rbug_screen_resource_destroy(struct pipe_screen *screen, rbug_resource_destroy(rbug_resource(_resource)); } -static struct pipe_surface * -rbug_screen_get_tex_surface(struct pipe_screen *_screen, - struct pipe_resource *_resource, - unsigned face, - unsigned level, - unsigned zslice, - unsigned usage) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct rbug_resource *rb_resource = rbug_resource(_resource); - struct pipe_screen *screen = rb_screen->screen; - struct pipe_resource *resource = rb_resource->resource; - struct pipe_surface *result; - - result = screen->get_tex_surface(screen, - resource, - face, - level, - zslice, - usage); - - if (result) - return rbug_surface_create(rb_resource, result); - return NULL; -} - -static void -rbug_screen_tex_surface_destroy(struct pipe_surface *_surface) -{ - rbug_surface_destroy(rbug_surface(_surface)); -} - - - static struct pipe_resource * rbug_screen_user_buffer_create(struct pipe_screen *_screen, void *ptr, @@ -246,16 +212,18 @@ rbug_screen_user_buffer_create(struct pipe_screen *_screen, static void rbug_screen_flush_frontbuffer(struct pipe_screen *_screen, - struct pipe_surface *_surface, + struct pipe_resource *_resource, + unsigned level, unsigned layer, void *context_private) { struct rbug_screen *rb_screen = rbug_screen(_screen); - struct rbug_surface *rb_surface = rbug_surface(_surface); + struct rbug_resource *rb_resource = rbug_resource(_resource); struct pipe_screen *screen = rb_screen->screen; - struct pipe_surface *surface = rb_surface->surface; + struct pipe_resource *resource = rb_resource->resource; screen->flush_frontbuffer(screen, - surface, + resource, + level, layer, context_private); } @@ -336,8 +304,6 @@ rbug_screen_create(struct pipe_screen *screen) rb_screen->base.resource_from_handle = rbug_screen_resource_from_handle; rb_screen->base.resource_get_handle = rbug_screen_resource_get_handle; rb_screen->base.resource_destroy = rbug_screen_resource_destroy; - rb_screen->base.get_tex_surface = rbug_screen_get_tex_surface; - rb_screen->base.tex_surface_destroy = rbug_screen_tex_surface_destroy; rb_screen->base.user_buffer_create = rbug_screen_user_buffer_create; rb_screen->base.flush_frontbuffer = rbug_screen_flush_frontbuffer; rb_screen->base.fence_reference = rbug_screen_fence_reference; |