diff options
author | Marek Olšák <[email protected]> | 2012-07-28 00:38:42 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-08-04 14:05:51 +0200 |
commit | 7c371f46958910dd2ca9487c89af1b72bbfdada9 (patch) | |
tree | 8232cc99829022eac4326fe34a15c911fe27dfef /src/gallium/drivers/r600/r600_texture.c | |
parent | 84645fa61390475e6efb080685e0dec059622a39 (diff) |
r600g: make sure copying of all texture formats is accelerated
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_texture.c | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 5e99a04a3eb..8fb24fd1888 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -419,40 +419,6 @@ static void r600_setup_miptree(struct pipe_screen *screen, rtex->size = offset; } -/* Figure out whether u_blitter will fallback to a transfer operation. - * If so, don't use a staging resource. - */ -static boolean permit_hardware_blit(struct pipe_screen *screen, - const struct pipe_resource *res) -{ - unsigned bind; - - if (util_format_is_depth_or_stencil(res->format)) - bind = PIPE_BIND_DEPTH_STENCIL; - else - bind = PIPE_BIND_RENDER_TARGET; - - /* hackaround for S3TC */ - if (util_format_is_compressed(res->format)) - return TRUE; - - if (!screen->is_format_supported(screen, - res->format, - res->target, - res->nr_samples, - bind)) - return FALSE; - - if (!screen->is_format_supported(screen, - res->format, - res->target, - res->nr_samples, - PIPE_BIND_SAMPLER_VIEW)) - return FALSE; - - return TRUE; -} - static boolean r600_texture_get_handle(struct pipe_screen* screen, struct pipe_resource *ptex, struct winsys_handle *whandle) @@ -577,10 +543,8 @@ r600_texture_create_object(struct pipe_screen *screen, /* Proceed in creating the depth buffer. */ } - /* only mark depth textures the HW can hit as depth textures */ - if (util_format_is_depth_or_stencil(rtex->real_format) && - permit_hardware_blit(screen, base)) - rtex->is_depth = true; + /* don't include stencil-only formats which we don't support for rendering */ + rtex->is_depth = util_format_has_depth(util_format_description(rtex->resource.b.b.format)); r600_setup_miptree(screen, rtex, array_mode); if (rscreen->use_surface_alloc) { @@ -648,8 +612,7 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen, if (rscreen->use_surface_alloc && !(templ->bind & PIPE_BIND_SCANOUT) && templ->usage != PIPE_USAGE_STAGING && - templ->usage != PIPE_USAGE_STREAM && - permit_hardware_blit(screen, templ)) { + templ->usage != PIPE_USAGE_STREAM) { array_mode = V_038000_ARRAY_2D_TILED_THIN1; } else if (util_format_is_compressed(templ->format)) { array_mode = V_038000_ARRAY_1D_TILED_THIN1; @@ -824,8 +787,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx, use_staging_texture = TRUE; } - if (!permit_hardware_blit(ctx->screen, texture) || - (texture->flags & R600_RESOURCE_FLAG_TRANSFER)) { + if (texture->flags & R600_RESOURCE_FLAG_TRANSFER) { use_staging_texture = FALSE; } |