Mesa (master): r600g: fixup states generation in winsys.

Jerome Glisse glisse at kemper.freedesktop.org
Mon Aug 30 19:02:24 UTC 2010


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Aug 26 14:55:48 2010 +1000

r600g: fixup states generation in winsys.

The current states code had an unhealthy relationship between
that had to somehow magically align themselves, editing either
place meant renumbering all states after the one you were on,
and it was pretty unapproachable code.

This replaces the huge types structures with a simple type + sub
type struct, which is keyed on an stype enum in radeon.h. Each
stype can have a per-shader type subclassing (4 types supported,
PS/VS/GS/FS), and also has a number of states per-subtype. So you
have 256 constants per 4 shaders per one CONSTANT stype.

The interface from the driver is changed to pass in the tuple,
(stype, id, shader_type), and we look for this. If
radeon_state_shader ever shows up on profile, it could use a
hashtable based on stype/shader_type to speed things up.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/r600/r600_blit.c       |   23 ++---
 src/gallium/drivers/r600/r600_context.c    |    2 +-
 src/gallium/drivers/r600/r600_draw.c       |   11 ++-
 src/gallium/drivers/r600/r600_query.c      |    4 +-
 src/gallium/drivers/r600/r600_shader.c     |    4 +-
 src/gallium/drivers/r600/r600_state.c      |   38 ++++----
 src/gallium/drivers/r600/r600_texture.c    |    8 +-
 src/gallium/drivers/r600/radeon.h          |  112 ++++++++--------------
 src/gallium/winsys/r600/drm/r600_state.c   |  133 ++++++++++++++++++++------
 src/gallium/winsys/r600/drm/r600_states.h  |  144 +++++++---------------------
 src/gallium/winsys/r600/drm/radeon.c       |   44 ---------
 src/gallium/winsys/r600/drm/radeon_ctx.c   |    6 +-
 src/gallium/winsys/r600/drm/radeon_draw.c  |   11 ++-
 src/gallium/winsys/r600/drm/radeon_priv.h  |   32 +++---
 src/gallium/winsys/r600/drm/radeon_state.c |   58 +++++++++---
 15 files changed, 295 insertions(+), 335 deletions(-)

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



More information about the mesa-commit mailing list