diff options
author | Marek Olšák <[email protected]> | 2017-09-07 00:13:37 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-09-07 17:59:37 +0200 |
commit | 4bd2bdbb3c1df08c185b7461474ce9b323fc1b7d (patch) | |
tree | b5066b738a74df87e8c25c30080523b62ed4c975 /src/gallium | |
parent | c4741bbb6fb98f78551f9e42ae570dcc924e0031 (diff) |
ac/surface: add radeon_surf::has_stencil for convenience
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_blit.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_texture.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_blit.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_binning.c | 2 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_surface.c | 1 |
8 files changed, 12 insertions, 11 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index a9b503f9f10..5e9c77d7921 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1371,7 +1371,7 @@ static void evergreen_init_depth_surface(struct r600_context *rctx, surf->db_depth_slice = S_02805C_SLICE_TILE_MAX(levelinfo->nblk_x * levelinfo->nblk_y / 64 - 1); - if (rtex->surface.flags & RADEON_SURF_SBUFFER) { + if (rtex->surface.has_stencil) { uint64_t stencil_offset; unsigned stile_split = rtex->surface.u.legacy.stencil_tile_split; diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 783d8c8a3bc..64f06e8bd4e 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -377,7 +377,7 @@ static bool r600_decompress_subresource(struct pipe_context *ctx, r600_blit_decompress_depth_in_place(rctx, rtex, false, level, level, first_layer, last_layer); - if (rtex->surface.flags & RADEON_SURF_SBUFFER) { + if (rtex->surface.has_stencil) { r600_blit_decompress_depth_in_place(rctx, rtex, true, level, level, first_layer, last_layer); diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 4c97efa73b2..c1bce8304b2 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -2030,7 +2030,7 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info rtex->dirty_level_mask |= 1 << surf->u.tex.level; - if (rtex->surface.flags & RADEON_SURF_SBUFFER) + if (rtex->surface.has_stencil) rtex->stencil_dirty_level_mask |= 1 << surf->u.tex.level; } if (rctx->framebuffer.compressed_cb_mask) { diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 47fd56fa6bf..26afc980ece 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -1168,7 +1168,7 @@ void r600_print_texture_info(struct r600_common_screen *rscreen, rtex->surface.u.legacy.level[i].mode, rtex->surface.u.legacy.tiling_index[i]); - if (rtex->surface.flags & RADEON_SURF_SBUFFER) { + if (rtex->surface.has_stencil) { u_log_printf(log, " StencilLayout: tilesplit=%u\n", rtex->surface.u.legacy.stencil_tile_split); for (i = 0; i <= rtex->resource.b.b.last_level; i++) { @@ -2120,7 +2120,7 @@ static void r600_clear_texture(struct pipe_context *pipe, clear = PIPE_CLEAR_DEPTH; desc->unpack_z_float(&depth, 0, data, 0, 1, 1); - if (rtex->surface.flags & RADEON_SURF_SBUFFER) { + if (rtex->surface.has_stencil) { clear |= PIPE_CLEAR_STENCIL; desc->unpack_s_8uint(&stencil, 0, data, 0, 1, 1); } diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 2f94f472836..0ecfc83fe24 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -973,7 +973,7 @@ static void si_decompress_subresource(struct pipe_context *ctx, if (rtex->db_compatible) { planes &= PIPE_MASK_Z | PIPE_MASK_S; - if (!(rtex->surface.flags & RADEON_SURF_SBUFFER)) + if (!rtex->surface.has_stencil) planes &= ~PIPE_MASK_S; /* If we've rendered into the framebuffer and it's a blitting diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 7e9140b8abf..ee070107fd5 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2327,7 +2327,7 @@ static void si_init_depth_surface(struct si_context *sctx, uint32_t z_info, s_info; format = si_translate_dbformat(rtex->db_render_format); - stencil_format = rtex->surface.flags & RADEON_SURF_SBUFFER ? + stencil_format = rtex->surface.has_stencil ? V_028044_STENCIL_8 : V_028044_STENCIL_INVALID; assert(format != V_028040_Z_INVALID); @@ -2372,7 +2372,7 @@ static void si_init_depth_surface(struct si_context *sctx, s_info |= S_02803C_ITERATE_FLUSH(1); } - if (rtex->surface.flags & RADEON_SURF_SBUFFER) { + if (rtex->surface.has_stencil) { /* Stencil buffer workaround ported from the SI-CI-VI code. * See that for explanation. */ @@ -2438,7 +2438,7 @@ static void si_init_depth_surface(struct si_context *sctx, z_info |= S_028040_TILE_SURFACE_ENABLE(1) | S_028040_ALLOW_EXPCLEAR(1); - if (rtex->surface.flags & RADEON_SURF_SBUFFER) { + if (rtex->surface.has_stencil) { /* Workaround: For a not yet understood reason, the * combination of MSAA, fast stencil clear and stencil * decompress messes with subsequent stencil buffer @@ -2494,7 +2494,7 @@ void si_update_fb_dirtiness_after_rendering(struct si_context *sctx) rtex->dirty_level_mask |= 1 << surf->u.tex.level; - if (rtex->surface.flags & RADEON_SURF_SBUFFER) + if (rtex->surface.has_stencil) rtex->stencil_dirty_level_mask |= 1 << surf->u.tex.level; } if (sctx->framebuffer.compressed_cb_mask) { diff --git a/src/gallium/drivers/radeonsi/si_state_binning.c b/src/gallium/drivers/radeonsi/si_state_binning.c index d75e86ea2ad..8d98d6d0d08 100644 --- a/src/gallium/drivers/radeonsi/si_state_binning.c +++ b/src/gallium/drivers/radeonsi/si_state_binning.c @@ -203,7 +203,7 @@ static struct uvec2 si_get_depth_bin_size(struct si_context *sctx) struct r600_texture *rtex = (struct r600_texture*)sctx->framebuffer.state.zsbuf->texture; unsigned depth_coeff = dsa->depth_enabled ? 5 : 0; - unsigned stencil_coeff = rtex->surface.flags & RADEON_SURF_SBUFFER && + unsigned stencil_coeff = rtex->surface.has_stencil && dsa->stencil_enabled ? 1 : 0; unsigned sum = 4 * (depth_coeff + stencil_coeff) * sctx->framebuffer.nr_samples; diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_surface.c b/src/gallium/winsys/radeon/drm/radeon_drm_surface.c index 39d648fff95..6cda59e921c 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_surface.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_surface.c @@ -187,6 +187,7 @@ static void surf_drm_to_winsys(struct radeon_drm_winsys *ws, surf_ws->blk_h = surf_drm->blk_h; surf_ws->bpe = surf_drm->bpe; surf_ws->is_linear = surf_drm->level[0].mode <= RADEON_SURF_MODE_LINEAR_ALIGNED; + surf_ws->has_stencil = !!(surf_drm->flags & RADEON_SURF_SBUFFER); surf_ws->flags = surf_drm->flags; surf_ws->surf_size = surf_drm->bo_size; |