[Mesa-dev] [RFC PATCH 0/6] r600: speed up tesselation shaders

Gert Wollny gw.fossdev at gmail.com
Wed Nov 15 09:29:10 UTC 2017


Dear all, 

since on r600 the tesselation shaders don't go through the sb-optimizer I 
though it might help to improve performance by applying some optimizations 
to the created assembly. The patches are experimental but to a point where 
I think some input from you could be helpful. 

This patch series does the following optimizations: 
- pre-calculate and re-use address offsets that were always calculated 
  on the fly
- only load from LDS what is really requested (based on the source swizzle masks 
  of the input values). 
- preload all used elements in cases where the shader would only partially load 
  data in different places. 

At this point there are no piglit regressions, but an unrelated GOU lockup is 
triggered. (Dave and me are already testing patches for this).

Benchmarking on BARTS with Unigine-Heaven and Tessmark x32 (with 
MESA_GL_VERSION_OVERRIDE=4.0) I get the following improvements: 

                    pre-opt         post-opt
              master: fb0e9b5197
===============================================
Heaven

Res:    1280x1024
Q:        High
Tess:    Normal
-----------------------------------------------
Time:                260.2          260.2
Frames:              3276            4192

FPS:                 12.6           16.1
Min FPS:             4.0             4.6
Max FPS:             60.9           69.0

Score:             317.2           405.8
-----------------------------------------------

Tessmark x32
R: 1024x640
-----------------------------------------------
Points:            635              700
FPS:                10               11

A github repo inclusing these patches can be found at 
 
  https://github.com/gerddie/mesa/tree/r600-tess-speedup

many thanks for any comments, 
Gert 

Gert Wollny (6):
  r600:shader: Fix all warnings issed with "-Wall -Wextra"
  r600_shader: only load from LDS what is really used
  r600_shader.c: Add a caching structure for load tesselation data
  r600_shader: Move calculation of offset to do_lds_fetch_values
  r600_shader.c: Pre-caclculate some offsets for LDS access
  r600_shader.c: Preload some LDS values.

 src/gallium/drivers/r600/r600_shader.c | 636 ++++++++++++++++++++++++---------
 1 file changed, 476 insertions(+), 160 deletions(-)

-- 
2.13.6



More information about the mesa-dev mailing list