diff options
author | Marek Olšák <[email protected]> | 2012-09-13 19:38:25 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-09-30 18:57:57 +0200 |
commit | de80660c2bd43db112b6c82d970660ed9806cd33 (patch) | |
tree | 115c132994d540743e6deed23dec941f8eb619b4 /src/gallium/drivers | |
parent | d37e6b15ad545106d48af5c8abb75d0e28895d43 (diff) |
gallium: remove resource_resolve
The functionality is provided by the new blit function.
Tested-by: Michel Dänzer <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/galahad/glhd_context.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nv30/nv30_miptree.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nv30/nv30_resource.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_surface.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_surface.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_render.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_blit.c | 152 |
7 files changed, 8 insertions, 158 deletions
diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index e20986fca6e..354f20a3ad7 100644 --- a/src/gallium/drivers/galahad/glhd_context.c +++ b/src/gallium/drivers/galahad/glhd_context.c @@ -1080,7 +1080,6 @@ galahad_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) //GLHD_PIPE_INIT(set_stream_output_targets); GLHD_PIPE_INIT(resource_copy_region); GLHD_PIPE_INIT(blit); - //GLHD_PIPE_INIT(resource_resolve); GLHD_PIPE_INIT(clear); GLHD_PIPE_INIT(clear_render_target); GLHD_PIPE_INIT(clear_depth_stencil); diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index 79034ac7dae..5a9a63ba0d9 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -148,6 +148,7 @@ void nv30_resource_resolve(struct pipe_context *pipe, const struct pipe_resolve_info *info) { +#if 0 struct nv30_context *nv30 = nv30_context(pipe); struct nv30_rect src, dst; @@ -157,6 +158,7 @@ nv30_resource_resolve(struct pipe_context *pipe, info->dst.x1 - info->dst.x0, info->dst.y1 - info->dst.y0, &dst); nv30_transfer_rect(nv30, BILINEAR, &src, &dst); +#endif } void diff --git a/src/gallium/drivers/nv30/nv30_resource.c b/src/gallium/drivers/nv30/nv30_resource.c index 80dc61efcb0..4d2a2284a75 100644 --- a/src/gallium/drivers/nv30/nv30_resource.c +++ b/src/gallium/drivers/nv30/nv30_resource.c @@ -75,6 +75,5 @@ nv30_resource_init(struct pipe_context *pipe) pipe->create_surface = nv30_miptree_surface_new; pipe->surface_destroy = nv30_miptree_surface_del; pipe->resource_copy_region = nv30_resource_copy_region; - pipe->resource_resolve = nv30_resource_resolve; pipe->blit = nv30_blit; } diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 69bc77233f5..68809ec181b 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -859,6 +859,7 @@ nv50_blitctx_post_blit(struct nv50_context *nv50, struct nv50_blitctx *blit) NV50_NEW_VERTPROG | NV50_NEW_GMTYPROG | NV50_NEW_FRAGPROG); } +#if 0 static void nv50_resource_resolve(struct pipe_context *pipe, const struct pipe_resolve_info *info) @@ -955,6 +956,7 @@ nv50_resource_resolve(struct pipe_context *pipe, nv50_blitctx_post_blit(nv50, blit); } +#endif boolean nv50_blitctx_create(struct nv50_screen *screen) @@ -983,7 +985,6 @@ nv50_init_surface_functions(struct nv50_context *nv50) struct pipe_context *pipe = &nv50->base.pipe; pipe->resource_copy_region = nv50_resource_copy_region; - pipe->resource_resolve = nv50_resource_resolve; pipe->clear_render_target = nv50_clear_render_target; pipe->clear_depth_stencil = nv50_clear_depth_stencil; } diff --git a/src/gallium/drivers/nvc0/nvc0_surface.c b/src/gallium/drivers/nvc0/nvc0_surface.c index d52de0b6186..d95124dec10 100644 --- a/src/gallium/drivers/nvc0/nvc0_surface.c +++ b/src/gallium/drivers/nvc0/nvc0_surface.c @@ -945,6 +945,7 @@ nvc0_blitctx_post_blit(struct nvc0_context *nvc0, struct nvc0_blitctx *blit) NVC0_NEW_TFB_TARGETS); } +#if 0 static void nvc0_resource_resolve(struct pipe_context *pipe, const struct pipe_resolve_info *info) @@ -1047,6 +1048,7 @@ nvc0_resource_resolve(struct pipe_context *pipe, nvc0_blitctx_post_blit(nvc0, blit); } +#endif boolean nvc0_blitctx_create(struct nvc0_screen *screen) @@ -1076,7 +1078,6 @@ nvc0_init_surface_functions(struct nvc0_context *nvc0) struct pipe_context *pipe = &nvc0->base.pipe; pipe->resource_copy_region = nvc0_resource_copy_region; - pipe->resource_resolve = nvc0_resource_resolve; pipe->clear_render_target = nvc0_clear_render_target; pipe->clear_depth_stencil = nvc0_clear_depth_stencil; } diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index e388260894c..198ab73d257 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -1254,6 +1254,7 @@ done: r300->sprite_coord_enable = last_sprite_coord_enable; } +#if 0 static void r300_resource_resolve(struct pipe_context *pipe, const struct pipe_resolve_info *info) { @@ -1303,6 +1304,7 @@ static void r300_resource_resolve(struct pipe_context *pipe, pipe_surface_reference(&srcsurf, NULL); pipe_surface_reference(&dstsurf, NULL); } +#endif void r300_init_render_functions(struct r300_context *r300) { @@ -1313,8 +1315,6 @@ void r300_init_render_functions(struct r300_context *r300) r300->context.draw_vbo = r300_swtcl_draw_vbo; } - r300->context.resource_resolve = r300_resource_resolve; - /* Plug in the two-sided stencil reference value fallback if needed. */ if (!r300->screen->caps.is_r500) r300_plug_in_stencil_ref_fallback(r300); diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 9ebb043168a..090121cccf5 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -351,67 +351,6 @@ static bool r600_decompress_subresource(struct pipe_context *ctx, return true; } -static void r600_copy_first_sample(struct pipe_context *ctx, - const struct pipe_resolve_info *info) -{ - struct r600_context *rctx = (struct r600_context *)ctx; - struct pipe_surface *dst_view, dst_templ; - struct pipe_sampler_view src_templ, *src_view; - struct pipe_box box; - - /* The driver doesn't decompress resources automatically while - * u_blitter is rendering. */ - if (!r600_decompress_subresource(ctx, info->src.res, 0, - info->src.layer, info->src.layer)) { - return; /* error */ - } - - /* this is correct for upside-down blits too */ - u_box_2d(info->src.x0, - info->src.y0, - info->src.x1 - info->src.x0, - info->src.y1 - info->src.y0, &box); - - /* Initialize the surface. */ - util_blitter_default_dst_texture(&dst_templ, info->dst.res, - info->dst.level, info->dst.layer, &box); - dst_view = ctx->create_surface(ctx, info->dst.res, &dst_templ); - - /* Initialize the sampler view. */ - util_blitter_default_src_texture(&src_templ, info->src.res, 0); - src_view = ctx->create_sampler_view(ctx, info->src.res, &src_templ); - - /* Copy the first sample into dst. */ - r600_blitter_begin(ctx, R600_COPY_TEXTURE); - util_blitter_blit_generic(rctx->blitter, dst_view, info->dst.x0, - info->dst.y0, abs(box.width), abs(box.height), - src_view, &box, - info->src.res->width0, info->src.res->height0, - info->mask, PIPE_TEX_FILTER_NEAREST, NULL, FALSE); - r600_blitter_end(ctx); - - pipe_surface_reference(&dst_view, NULL); - pipe_sampler_view_reference(&src_view, NULL); -} - -static boolean is_simple_resolve(const struct pipe_resolve_info *info) -{ - unsigned dst_width = u_minify(info->dst.res->width0, info->dst.level); - unsigned dst_height = u_minify(info->dst.res->height0, info->dst.level); - - return info->dst.res->format == info->src.res->format && - dst_width == info->src.res->width0 && - dst_height == info->src.res->height0 && - info->dst.x0 == 0 && - info->dst.y0 == 0 && - info->dst.x1 == dst_width && - info->dst.y1 == dst_height && - info->src.x0 == 0 && - info->src.y0 == 0 && - info->src.x1 == dst_width && - info->src.y1 == dst_height; -} - static boolean is_simple_msaa_resolve(const struct pipe_blit_info *info) { unsigned dst_width = u_minify(info->dst.resource->width0, info->dst.level); @@ -434,96 +373,6 @@ static boolean is_simple_msaa_resolve(const struct pipe_blit_info *info) info->src.box.height == dst_height; } -static void r600_color_resolve(struct pipe_context *ctx, - const struct pipe_resolve_info *info) -{ - struct r600_context *rctx = (struct r600_context *)ctx; - struct pipe_screen *screen = ctx->screen; - struct pipe_resource *tmp, templ; - struct pipe_box box; - unsigned sample_mask = - rctx->chip_class == CAYMAN ? ~0 : ((1ull << MAX2(1, info->src.res->nr_samples)) - 1); - - assert((info->mask & PIPE_MASK_RGBA) == PIPE_MASK_RGBA); - - if (is_simple_resolve(info)) { - r600_blitter_begin(ctx, R600_COLOR_RESOLVE); - util_blitter_custom_resolve_color(rctx->blitter, - info->dst.res, info->dst.level, info->dst.layer, - info->src.res, info->src.layer, - sample_mask, rctx->custom_blend_resolve); - r600_blitter_end(ctx); - return; - } - - /* resolve into a temporary texture, then blit */ - templ.target = PIPE_TEXTURE_2D; - templ.format = info->src.res->format; - templ.width0 = info->src.res->width0; - templ.height0 = info->src.res->height0; - templ.depth0 = 1; - templ.array_size = 1; - templ.last_level = 0; - templ.nr_samples = 0; - templ.usage = PIPE_USAGE_STATIC; - templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW; - templ.flags = 0; - - tmp = screen->resource_create(screen, &templ); - - /* XXX use scissor, so that only the needed part of the resource is resolved */ - r600_blitter_begin(ctx, R600_COLOR_RESOLVE); - util_blitter_custom_resolve_color(rctx->blitter, - tmp, 0, 0, - info->src.res, info->src.layer, - sample_mask, rctx->custom_blend_resolve); - r600_blitter_end(ctx); - - /* this is correct for upside-down blits too */ - u_box_2d(info->src.x0, - info->src.y0, - info->src.x1 - info->src.x0, - info->src.y1 - info->src.y0, &box); - - r600_blitter_begin(ctx, R600_COPY_TEXTURE); - util_blitter_copy_texture(rctx->blitter, info->dst.res, info->dst.level, - info->dst.x0, info->dst.y0, info->dst.layer, - tmp, 0, &box, PIPE_MASK_RGBAZS, FALSE); - r600_blitter_end(ctx); - - pipe_resource_reference(&tmp, NULL); -} - -static void r600_resource_resolve(struct pipe_context *ctx, - const struct pipe_resolve_info *info) -{ - /* make sure we're doing a resolve operation */ - assert(info->src.res->nr_samples > 1); - assert(info->dst.res->nr_samples <= 1); - - /* limitations of multisample resources */ - assert(info->src.res->last_level == 0); - assert(info->src.res->target == PIPE_TEXTURE_2D || - info->src.res->target == PIPE_TEXTURE_2D_ARRAY); - - /* check if the resolve box is valid */ - assert(info->dst.x0 < info->dst.x1); - assert(info->dst.y0 < info->dst.y1); - - /* scaled resolve isn't allowed */ - assert(abs(info->dst.x0 - info->dst.x1) == - abs(info->src.x0 - info->src.x1)); - assert(abs(info->dst.y0 - info->dst.y1) == - abs(info->src.y0 - info->src.y1)); - - if ((info->mask & PIPE_MASK_ZS) || - util_format_is_pure_integer(info->src.res->format)) { - r600_copy_first_sample(ctx, info); - } else { - r600_color_resolve(ctx, info); - } -} - static void r600_clear(struct pipe_context *ctx, unsigned buffers, const union pipe_color_union *color, double depth, unsigned stencil) @@ -892,6 +741,5 @@ void r600_init_blit_functions(struct r600_context *rctx) rctx->context.clear_render_target = r600_clear_render_target; rctx->context.clear_depth_stencil = r600_clear_depth_stencil; rctx->context.resource_copy_region = r600_resource_copy_region; - rctx->context.resource_resolve = r600_resource_resolve; rctx->context.blit = r600_blit; } |