[Mesa-dev] [PATCH 5/7] radeonsi: rename depth decompress functions
Marek Olšák
maraeo at gmail.com
Wed Jun 7 19:50:57 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeonsi/si_blit.c | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 20b08b6..e39ba62 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -303,25 +303,25 @@ si_blit_decompress_zs_in_place(struct si_context *sctx,
if (levels_s) {
si_blit_decompress_zs_planes_in_place(
sctx, texture, PIPE_MASK_S,
levels_s,
first_layer, last_layer);
}
}
static void
-si_flush_depth_texture(struct si_context *sctx,
- struct r600_texture *tex,
- unsigned required_planes,
- unsigned first_level, unsigned last_level,
- unsigned first_layer, unsigned last_layer)
+si_decompress_depth(struct si_context *sctx,
+ struct r600_texture *tex,
+ unsigned required_planes,
+ unsigned first_level, unsigned last_level,
+ unsigned first_layer, unsigned last_layer)
{
unsigned inplace_planes = 0;
unsigned copy_planes = 0;
unsigned level_mask = u_bit_consecutive(first_level, last_level - first_level + 1);
unsigned levels_z = 0;
unsigned levels_s = 0;
if (required_planes & PIPE_MASK_Z) {
levels_z = level_mask & tex->dirty_level_mask;
@@ -384,45 +384,44 @@ si_flush_depth_texture(struct si_context *sctx,
if (inplace_planes) {
si_blit_decompress_zs_in_place(
sctx, tex,
levels_z, levels_s,
first_layer, last_layer);
}
}
static void
-si_flush_depth_textures(struct si_context *sctx,
- struct si_textures_info *textures)
+si_decompress_sampler_depth_textures(struct si_context *sctx,
+ struct si_textures_info *textures)
{
unsigned i;
unsigned mask = textures->needs_depth_decompress_mask;
while (mask) {
struct pipe_sampler_view *view;
struct si_sampler_view *sview;
struct r600_texture *tex;
i = u_bit_scan(&mask);
view = textures->views.views[i];
assert(view);
sview = (struct si_sampler_view*)view;
tex = (struct r600_texture *)view->texture;
assert(tex->db_compatible);
- si_flush_depth_texture(
- sctx, tex,
- sview->is_stencil_sampler ? PIPE_MASK_S : PIPE_MASK_Z,
- view->u.tex.first_level, view->u.tex.last_level,
- 0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level));
+ si_decompress_depth(sctx, tex,
+ sview->is_stencil_sampler ? PIPE_MASK_S : PIPE_MASK_Z,
+ view->u.tex.first_level, view->u.tex.last_level,
+ 0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level));
}
}
static void si_blit_decompress_color(struct pipe_context *ctx,
struct r600_texture *rtex,
unsigned first_level, unsigned last_level,
unsigned first_layer, unsigned last_layer,
bool need_dcc_decompress)
{
struct si_context *sctx = (struct si_context *)ctx;
@@ -658,21 +657,21 @@ static void si_decompress_textures(struct si_context *sctx, unsigned shader_mask
sctx->b.last_compressed_colortex_counter = compressed_colortex_counter;
si_update_compressed_colortex_masks(sctx);
}
/* Decompress color & depth textures if needed. */
mask = sctx->compressed_tex_shader_mask & shader_mask;
while (mask) {
unsigned i = u_bit_scan(&mask);
if (sctx->samplers[i].needs_depth_decompress_mask) {
- si_flush_depth_textures(sctx, &sctx->samplers[i]);
+ si_decompress_sampler_depth_textures(sctx, &sctx->samplers[i]);
}
if (sctx->samplers[i].needs_color_decompress_mask) {
si_decompress_sampler_color_textures(sctx, &sctx->samplers[i]);
}
if (sctx->images[i].needs_color_decompress_mask) {
si_decompress_image_color_textures(sctx, &sctx->images[i]);
}
}
si_check_render_feedback(sctx);
@@ -833,23 +832,23 @@ static void si_decompress_subresource(struct pipe_context *ctx,
{
struct si_context *sctx = (struct si_context *)ctx;
struct r600_texture *rtex = (struct r600_texture*)tex;
if (rtex->db_compatible) {
planes &= PIPE_MASK_Z | PIPE_MASK_S;
if (!(rtex->surface.flags & RADEON_SURF_SBUFFER))
planes &= ~PIPE_MASK_S;
- si_flush_depth_texture(sctx, rtex, planes,
- level, level,
- first_layer, last_layer);
+ si_decompress_depth(sctx, rtex, planes,
+ level, level,
+ first_layer, last_layer);
} else if (rtex->fmask.size || rtex->cmask.size || rtex->dcc_offset) {
si_blit_decompress_color(ctx, rtex, level, level,
first_layer, last_layer, false);
}
}
struct texture_orig_info {
unsigned format;
unsigned width0;
unsigned height0;
--
2.7.4
More information about the mesa-dev
mailing list