[Mesa-dev] Splitting fs-instruction emission out of fs_visitor

Topi Pohjolainen topi.pohjolainen at intel.com
Wed May 28 05:35:56 PDT 2014


Here is some restructuring I've done in the compiler backend, mostly
for the fragment shader side. It allows me to introduce gen6/7 stencil
texturing without growing the already large fs_visitor even more.

I identified some common logic between fs and vec4 visitors and moved
these into brw_shader. The main thing the series really accomplishes
is breaking the dependency of fs_inst and fs_reg of fs_visitor. They
now only depend on backend_emitter. The newly introduced fs_emitter
depends on those and finally fs_visitor on fs_emitter.

In terms of class diagram:

           before                          after
           ------                          -----

       backend_visitor         backend_visitor   backend_emitter
             |                       |                 |
            / \                     / \               / \
             |                       |                 |
      +------+------+         +------+------+   +------+------+
      |             |         |             |   |             |
 vec4_visitor   fs_visitor    |          vec4_visitor     fs_emitter
                              |                               |
                              |                              / \
                              |                               |
                              |                               |
                              |                               |
                              +---------------+---------------+
                                              |
                                          fs_visitor

I saw no piglit regressions using IVB.

Topi Pohjolainen (14):
  i965: Split emitter out of backend_visitor
  i965: Merge emission memory context setup for shader visitors
  i965: Merge max_grf between stage compilers
  i965/vec4: Use unsigned instead of signed for visitor uniform count
  i965: Merge variable hashtables of fs and vec4 visitors
  i965: Merge fail() for ir visitors
  i965/vec4: Move virtual register map into backend_emitter
  i965: Refactor virtual register allocation between fs and vec4
  i965: Merge resolving of register size between fs and vec4
  i965: Merge common members of visitors
  i965/fs: Reduce scope for the visitor
  i965/fs: Split declarations of fs_reg and fs_inst out of brw_fs.h
  i965/fs: Split LIR emission ouf of ir-visitor
  i965/fs: Move emission of ALUs into fs_emitter

 src/mesa/drivers/dri/i965/Makefile.sources         |   1 +
 src/mesa/drivers/dri/i965/brw_cfg.cpp              |   8 +-
 src/mesa/drivers/dri/i965/brw_cfg.h                |   4 +-
 .../drivers/dri/i965/brw_dead_control_flow.cpp     |   6 +-
 src/mesa/drivers/dri/i965/brw_dead_control_flow.h  |   2 +-
 src/mesa/drivers/dri/i965/brw_fs.cpp               | 229 +----------------
 src/mesa/drivers/dri/i965/brw_fs.h                 | 249 +-----------------
 src/mesa/drivers/dri/i965/brw_fs_emit.h            | 285 +++++++++++++++++++++
 src/mesa/drivers/dri/i965/brw_fs_emitter.cpp       | 206 +++++++++++++++
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp  |   2 +-
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp       |  53 +---
 .../drivers/dri/i965/brw_schedule_instructions.cpp |   4 +-
 src/mesa/drivers/dri/i965/brw_shader.cpp           | 145 ++++++++++-
 src/mesa/drivers/dri/i965/brw_shader.h             |  75 +++++-
 src/mesa/drivers/dri/i965/brw_vec4.cpp             |  16 +-
 src/mesa/drivers/dri/i965/brw_vec4.h               |  38 +--
 .../drivers/dri/i965/brw_vec4_reg_allocate.cpp     |   2 +-
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp     | 142 +---------
 src/mesa/drivers/dri/i965/brw_vec4_vp.cpp          |   2 +-
 19 files changed, 743 insertions(+), 726 deletions(-)
 create mode 100644 src/mesa/drivers/dri/i965/brw_fs_emit.h
 create mode 100644 src/mesa/drivers/dri/i965/brw_fs_emitter.cpp

-- 
1.8.3.1



More information about the mesa-dev mailing list