summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-04-22 13:46:13 -0500
committerNicolai Hähnle <[email protected]>2016-04-27 11:16:39 -0500
commit0b70fc2db4555fb572fcb3695bf570f4720dbb81 (patch)
treee3380cba72eb0610be6313cf5fefd4e2e9b166c6 /src/gallium
parentdef53a0b3dd5e66f556b29fba06f55ff7f8b0a0e (diff)
radeonsi: only decompress the required ZS planes from si_blit
This happens to "fix" a rendering bug in KotOR2, because it avoids a still not quite understood bug with MSAA fast stencil clear decompress. For the stencil clear bug, I have sent a piglit test (arb_texture_multisample-stencil-clear). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93767 Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index e044538d40c..39ef98e8aea 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -596,17 +596,17 @@ static void si_clear_depth_stencil(struct pipe_context *ctx,
* rendering. */
static void si_decompress_subresource(struct pipe_context *ctx,
struct pipe_resource *tex,
- unsigned level,
+ unsigned planes, unsigned level,
unsigned first_layer, unsigned last_layer)
{
struct si_context *sctx = (struct si_context *)ctx;
struct r600_texture *rtex = (struct r600_texture*)tex;
if (rtex->is_depth && !rtex->is_flushing_texture) {
- unsigned planes = PIPE_MASK_Z;
+ planes &= PIPE_MASK_Z | PIPE_MASK_S;
- if (rtex->surface.flags & RADEON_SURF_SBUFFER)
- planes |= PIPE_MASK_S;
+ if (!(rtex->surface.flags & RADEON_SURF_SBUFFER))
+ planes &= ~PIPE_MASK_S;
si_blit_decompress_zs_in_place(sctx, rtex, planes,
level, level,
@@ -652,7 +652,7 @@ void si_resource_copy_region(struct pipe_context *ctx,
/* The driver doesn't decompress resources automatically while
* u_blitter is rendering. */
- si_decompress_subresource(ctx, src, src_level,
+ si_decompress_subresource(ctx, src, PIPE_MASK_RGBAZS, src_level,
src_box->z, src_box->z + src_box->depth - 1);
dst_width = u_minify(dst->width0, dst_level);
@@ -868,7 +868,8 @@ static void si_blit(struct pipe_context *ctx,
/* The driver doesn't decompress resources automatically while
* u_blitter is rendering. */
- si_decompress_subresource(ctx, info->src.resource, info->src.level,
+ si_decompress_subresource(ctx, info->src.resource, info->mask,
+ info->src.level,
info->src.box.z,
info->src.box.z + info->src.box.depth - 1);