[Mesa-dev] [PATCH 00/29] Make more use of bitmasks v3

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Tue Jun 14 04:59:31 UTC 2016


From: Mathias Fröhlich <Mathias.Froehlich at gmx.net>


Hi all,

following a series with performance improvements
for cpu/draw bound applications. This part makes
more use of the bitmask/ffs technique for iterating
a set of enabled items. The gains are not huge
but they are noticable for some of my favourite
workloads.

Changes in v2:

Past the suggestion from Brian Paul and the
discussion about maintainability I
switched to gallium/u_bit_scan{,64} style
functions for the series of changes.
Providing them and using them in some places
in core mesa make up the two new patches upfront.

Appart from that the problem spotted
by Roland Scheidegger is fixed and the changes
requested all around are incorporated.

Changes in v3:

Rename _mesa_bit_scan* to u_bit_scan*.
Comment formating changes.
Rebase to master.

Ok to push?

Thanks

Mathias


Mathias Fröhlich (29):
  mesa: Add gl_point_attrib::CoordReplaceBits bitfield.
  swrast: Convert swrast to use CoordsReplaceBits.
  gallium: Convert the state_tracker to use CoordsReplaceBits.
  r200: convert r200 to use CoordsReplaceBits.
  i915: Convert i915 to use CoordsReplaceBits.
  i965: Convert i965 to use CoordsReplaceBits.
  mesa: Remove the now unused CoordsReplace array.
  mesa: Rename CoordReplaceBits back to CoordReplace.
  mesa: Track enabled lights in a bitmask
  mesa: Use bitmask/ffs to iterate enabled lights
  mesa: Use bitmask/ffs to iterate enabled lights for ff shader keys.
  tnl: Use bitmask/ffs to iterate enabled lights
  nouveau: Use bitmask/ffs to iterate enabled lights
  radeon/r200: Use bitmask/ffs to iterate enabled lights
  mesa: Switch to bitmask based enabled lights in gen_matypes.c
  mesa: Remove the linked list of enabled lights
  mesa: Use bitmask/ffs to build ff vertex shader keys.
  mesa: Use bitmask/ffs to build ff fragment shader keys.
  mesa: Use bitmask/ffs to iterate color material attributes.
  mesa: Use bitmask/ffs to iterate enabled clip planes.
  radeon/r200: Use bitmask/ffs to iterate enabled clip planes.
  i965: Use bitmask/ffs to iterate enabled clip planes.
  i965: Use bitmask/ffs to iterate used vertex attributes.
  mesa: Use bitmask/ffs to iterate SamplersUsed
  mesa: Use designated bool value to check texture unit completeness.
  mesa: Use bitmask/ffs to iterate the enabled textures.
  mesa: Use bitmask/ffs to iterate the active_samplers bitmask.
  vbo: Use a bitmask to track the active arrays in vbo_exec*.
  vbo: Use a bitmask to track the active arrays in vbo_save*.

 src/mesa/drivers/common/meta.c                |  22 ++--
 src/mesa/drivers/dri/i915/i915_state.c        |  17 ++-
 src/mesa/drivers/dri/i965/brw_curbe.c         |  21 ++--
 src/mesa/drivers/dri/i965/brw_draw.c          |  10 +-
 src/mesa/drivers/dri/i965/brw_sf.c            |   7 +-
 src/mesa/drivers/dri/i965/brw_vs.c            |   6 +-
 src/mesa/drivers/dri/i965/gen6_sf_state.c     |   2 +-
 src/mesa/drivers/dri/nouveau/nouveau_state.c  |  10 +-
 src/mesa/drivers/dri/nouveau/nv10_state_tnl.c |  27 +++--
 src/mesa/drivers/dri/nouveau/nv20_state_tnl.c |  27 +++--
 src/mesa/drivers/dri/r200/r200_state.c        |  66 ++++++------
 src/mesa/drivers/dri/radeon/radeon_state.c    |  61 ++++++-----
 src/mesa/main/attrib.c                        |   2 +-
 src/mesa/main/context.c                       |  11 +-
 src/mesa/main/enable.c                        |   6 +-
 src/mesa/main/ff_fragment_shader.cpp          |  10 +-
 src/mesa/main/ffvertex_prog.c                 |  36 ++++---
 src/mesa/main/light.c                         |  60 +++++++----
 src/mesa/main/matrix.c                        |  19 ++--
 src/mesa/main/mtypes.h                        |   8 +-
 src/mesa/main/points.c                        |   6 +-
 src/mesa/main/rastpos.c                       |  28 ++---
 src/mesa/main/texenv.c                        |  32 +++---
 src/mesa/main/texstate.c                      |  34 +++---
 src/mesa/main/uniform_query.cpp               |   8 +-
 src/mesa/main/uniforms.c                      |  42 ++++----
 src/mesa/state_tracker/st_atom_rasterizer.c   |   8 +-
 src/mesa/swrast/s_points.c                    |   4 +-
 src/mesa/tnl/t_vb_cliptmp.h                   |  51 +++++----
 src/mesa/tnl/t_vb_light.c                     |  15 ++-
 src/mesa/tnl/t_vb_lighttmp.h                  |  24 +++--
 src/mesa/tnl/t_vb_program.c                   |  65 ++++++------
 src/mesa/tnl/t_vb_render.c                    |   1 +
 src/mesa/tnl/t_vb_vertex.c                    |  59 ++++++-----
 src/mesa/vbo/vbo_exec.h                       |   1 +
 src/mesa/vbo/vbo_exec_api.c                   | 146 ++++++++++++++------------
 src/mesa/vbo/vbo_exec_draw.c                  |   2 +
 src/mesa/vbo/vbo_save.h                       |   2 +
 src/mesa/vbo/vbo_save_api.c                   |  67 +++++++-----
 src/mesa/vbo/vbo_save_draw.c                  |  55 +++++-----
 src/mesa/x86/gen_matypes.c                    |   4 +-
 41 files changed, 567 insertions(+), 515 deletions(-)

-- 
2.5.5



More information about the mesa-dev mailing list