Mesa (master): r300g: fix another crash with hyperz
Marek Olšák
mareko at kemper.freedesktop.org
Fri Apr 8 21:18:31 UTC 2011
Module: Mesa
Branch: master
Commit: 69c71396c6e947cbdf878bacb655d472a11c7708
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=69c71396c6e947cbdf878bacb655d472a11c7708
Author: Marek Olšák <maraeo at gmail.com>
Date: Fri Apr 8 23:16:17 2011 +0200
r300g: fix another crash with hyperz
https://bugs.freedesktop.org/show_bug.cgi?id=36086
---
src/gallium/drivers/r300/r300_blit.c | 23 +----------------------
src/gallium/drivers/r300/r300_state.c | 1 +
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index 056b52f..ede0a23 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -304,16 +304,10 @@ static void r300_clear_render_target(struct pipe_context *pipe,
{
struct r300_context *r300 = r300_context(pipe);
- r300->hyperz_locked = TRUE;
- r300_mark_atom_dirty(r300, &r300->hyperz_state);
-
r300_blitter_begin(r300, R300_CLEAR_SURFACE);
util_blitter_clear_render_target(r300->blitter, dst, rgba,
dstx, dsty, width, height);
r300_blitter_end(r300);
-
- r300->hyperz_locked = FALSE;
- r300_mark_atom_dirty(r300, &r300->hyperz_state);
}
/* Clear a region of a depth stencil surface. */
@@ -332,21 +326,14 @@ static void r300_clear_depth_stencil(struct pipe_context *pipe,
if (r300->zmask_in_use && !r300->hyperz_locked) {
if (fb->zsbuf->texture == dst->texture) {
r300_decompress_zmask(r300);
- } else {
- r300->hyperz_locked = TRUE;
- r300_mark_atom_dirty(r300, &r300->hyperz_state);
}
}
+ /* XXX Do not decompress ZMask of the currently-set zbuffer. */
r300_blitter_begin(r300, R300_CLEAR_SURFACE);
util_blitter_clear_depth_stencil(r300->blitter, dst, clear_flags, depth, stencil,
dstx, dsty, width, height);
r300_blitter_end(r300);
-
- if (r300->hyperz_locked) {
- r300->hyperz_locked = FALSE;
- r300_mark_atom_dirty(r300, &r300->hyperz_state);
- }
}
void r300_decompress_zmask(struct r300_context *r300)
@@ -433,9 +420,6 @@ static void r300_resource_copy_region(struct pipe_context *pipe,
if (fb->zsbuf->texture == src ||
fb->zsbuf->texture == dst) {
r300_decompress_zmask(r300);
- } else {
- r300->hyperz_locked = TRUE;
- r300_mark_atom_dirty(r300, &r300->hyperz_state);
}
}
@@ -511,11 +495,6 @@ static void r300_resource_copy_region(struct pipe_context *pipe,
r300_resource_set_properties(pipe->screen, src, 0, &old_src);
if (old_dst.format != new_dst.format)
r300_resource_set_properties(pipe->screen, dst, 0, &old_dst);
-
- if (r300->hyperz_locked) {
- r300->hyperz_locked = FALSE;
- r300_mark_atom_dirty(r300, &r300->hyperz_state);
- }
}
void r300_init_blit_functions(struct r300_context *r300)
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 61d6751..c92f871 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -856,6 +856,7 @@ r300_set_framebuffer_state(struct pipe_context* pipe,
}
}
}
+ assert(state->zsbuf || r300->hyperz_locked || !r300->zmask_in_use);
/* Need to reset clamping or colormask. */
r300_mark_atom_dirty(r300, &r300->blend_state);
More information about the mesa-commit
mailing list