From 428e37c2da420f7dc14a2ea265f2387270f9bee1 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 2 Oct 2012 22:02:54 +0200 Subject: r600g: add in-place DB decompression and texturing with DB tiling The decompression is done in-place and only the compressed tiles are decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F. The texture unit is programmed to use non-displayable tiling and depth ordering of samples, so that it can fetch the texture in the native DB format. The latest version of the libdrm surface allocator is required for stencil texturing to work. The old one didn't create the mipmap tree correctly. We need a separate mipmap tree for stencil, because the stencil mipmap offsets are not really depth offsets/4. There are still some known bugs, but this should save some memory and it also improves performance a little bit in Lightsmark (especially with low resolutions; tested with Radeon HD 5000). The DB->CB copy is still used for transfers. Reviewed-by: Jerome Glisse --- src/gallium/drivers/r600/r600_resource.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/r600/r600_resource.h') diff --git a/src/gallium/drivers/r600/r600_resource.h b/src/gallium/drivers/r600/r600_resource.h index 7ebf59e23a5..007d5e08d35 100644 --- a/src/gallium/drivers/r600/r600_resource.h +++ b/src/gallium/drivers/r600/r600_resource.h @@ -48,7 +48,7 @@ struct r600_texture { unsigned array_mode[PIPE_MAX_TEXTURE_LEVELS]; unsigned pitch_override; unsigned size; - unsigned tile_type; + bool non_disp_tiling; bool is_depth; bool is_rat; unsigned dirty_level_mask; /* each bit says if that mipmap is compressed */ @@ -115,6 +115,14 @@ struct r600_surface { unsigned pa_su_poly_offset_db_fmt_cntl; }; +/* Return if the depth format can be read without the DB->CB copy on r6xx-r7xx. */ +static INLINE bool r600_can_read_depth(struct r600_texture *rtex) +{ + return rtex->resource.b.b.nr_samples <= 1 && + (rtex->resource.b.b.format == PIPE_FORMAT_Z16_UNORM || + rtex->resource.b.b.format == PIPE_FORMAT_Z32_FLOAT); +} + void r600_resource_destroy(struct pipe_screen *screen, struct pipe_resource *res); void r600_init_screen_resource_functions(struct pipe_screen *screen); -- cgit v1.2.3