Mesa (master): r300g: fix some bugs with zbuffer compression (v4)

Marek Olšák mareko at kemper.freedesktop.org
Thu Jan 27 17:18:18 UTC 2011


Module: Mesa
Branch: master
Commit: db299a9f8244d53d9041fcdbd396a77ebe1f9e3e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=db299a9f8244d53d9041fcdbd396a77ebe1f9e3e

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Jan 25 05:37:52 2011 +0100

r300g: fix some bugs with zbuffer compression (v4)

This drops the memblock manager for ZMASK. Instead, only one zbuffer can be
compressed at a time. Note that this does not necessarily have to be slower.
When there is a large number of zbuffers, compression might be used more often
than it was before. It's also easier to debug.

How it works:
1) 'clear' turns the compression on.
2) If some other zbuffer is set or the currently-bound zbuffer is used
   for texturing, the driver decompresses it and then turns the compression off.

Notes:
- The ZMASK clear has been refactored, so that only one packet3 is used to clear
  ZMASK.
- The 8x8 compression mode is disabled. I couldn't make it work without issues.
- Also removed driver-specific stuff from u_blitter.

Driver status:
- RV530 and R580 appear to just work (finally).
- RV570 should work, but there may be an issue that we don't correctly
  calculate the number of dwords to clear, resulting in a partially
  uninitialized zbuffer.
- RS690 misrenders as if no ZMASK clear happened. No idea what's going on.
- RV350 may even hardlock. This issue was already present and this patch doesn't
  fix it.

I think we are still missing some hardware info we need to make the zbuffer
compression work fully.

Note that there is also an issue with HiZ, resulting in a sort of blocky
zigzagged corruption around some objects.

---

 src/gallium/auxiliary/util/u_blitter.c        |   77 +++++----
 src/gallium/auxiliary/util/u_blitter.h        |   13 +-
 src/gallium/auxiliary/util/u_inlines.h        |   15 ++
 src/gallium/drivers/r300/r300_blit.c          |  227 ++++++++++++++-----------
 src/gallium/drivers/r300/r300_chipset.c       |    2 +
 src/gallium/drivers/r300/r300_chipset.h       |   13 ++-
 src/gallium/drivers/r300/r300_context.c       |   17 ++-
 src/gallium/drivers/r300/r300_context.h       |   25 ++-
 src/gallium/drivers/r300/r300_emit.c          |   88 +++++-----
 src/gallium/drivers/r300/r300_hyperz.c        |  120 +++----------
 src/gallium/drivers/r300/r300_hyperz.h        |    2 +-
 src/gallium/drivers/r300/r300_state.c         |   66 +++++---
 src/gallium/drivers/r300/r300_state_derived.c |   28 +++-
 src/gallium/drivers/r300/r300_texture.c       |    2 -
 14 files changed, 364 insertions(+), 331 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=db299a9f8244d53d9041fcdbd396a77ebe1f9e3e



More information about the mesa-commit mailing list