diff options
author | Marek Olšák <[email protected]> | 2014-02-09 23:25:06 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-02-25 16:08:26 +0100 |
commit | 9855477e903e00f7457adb15594048416444b992 (patch) | |
tree | da51847185f2d2d7821844c7887602ff406b8399 /src/gallium/drivers/r600 | |
parent | b9aa8ed009c22e4ef5df49dc7785f08fd3dbe836 (diff) |
r600g,radeonsi: consolidate create_surface and surface_destroy
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 5f9e8b7af98..1ca2c90794a 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -1727,48 +1727,6 @@ void r600_emit_shader(struct r600_context *rctx, struct r600_atom *a) radeon_emit(cs, r600_context_bo_reloc(&rctx->b, &rctx->b.rings.gfx, shader->bo, RADEON_USAGE_READ)); } -struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe, - struct pipe_resource *texture, - const struct pipe_surface *templ, - unsigned width, unsigned height) -{ - struct r600_surface *surface = CALLOC_STRUCT(r600_surface); - - assert(templ->u.tex.first_layer <= util_max_layer(texture, templ->u.tex.level)); - assert(templ->u.tex.last_layer <= util_max_layer(texture, templ->u.tex.level)); - if (surface == NULL) - return NULL; - pipe_reference_init(&surface->base.reference, 1); - pipe_resource_reference(&surface->base.texture, texture); - surface->base.context = pipe; - surface->base.format = templ->format; - surface->base.width = width; - surface->base.height = height; - surface->base.u = templ->u; - return &surface->base; -} - -static struct pipe_surface *r600_create_surface(struct pipe_context *pipe, - struct pipe_resource *tex, - const struct pipe_surface *templ) -{ - unsigned level = templ->u.tex.level; - - return r600_create_surface_custom(pipe, tex, templ, - u_minify(tex->width0, level), - u_minify(tex->height0, level)); -} - -static void r600_surface_destroy(struct pipe_context *pipe, - struct pipe_surface *surface) -{ - struct r600_surface *surf = (struct r600_surface*)surface; - pipe_resource_reference((struct pipe_resource**)&surf->cb_buffer_fmask, NULL); - pipe_resource_reference((struct pipe_resource**)&surf->cb_buffer_cmask, NULL); - pipe_resource_reference(&surface->texture, NULL); - FREE(surface); -} - unsigned r600_get_swizzle_combined(const unsigned char *swizzle_format, const unsigned char *swizzle_view, boolean vtx) @@ -2280,8 +2238,6 @@ void r600_init_common_state_functions(struct r600_context *rctx) rctx->b.b.sampler_view_destroy = r600_sampler_view_destroy; rctx->b.b.texture_barrier = r600_texture_barrier; rctx->b.b.set_stream_output_targets = r600_set_streamout_targets; - rctx->b.b.create_surface = r600_create_surface; - rctx->b.b.surface_destroy = r600_surface_destroy; rctx->b.b.draw_vbo = r600_draw_vbo; rctx->b.invalidate_buffer = r600_invalidate_buffer; rctx->b.set_occlusion_query_state = r600_set_occlusion_query_state; |