[Mesa-dev] [PATCH 00/16] Expand opt_minmax get_range v2

Thomas Helland thomashelland90 at gmail.com
Sun Nov 16 17:51:45 PST 2014


My exams are aproaching fast, so I thought I'd put this second
version of the series onto the list.

This hopefully addresses the issues with the first version.
I have tested that I don't cause regressions with Brutal Legend,
and that I maintain the improvement in Dungeon Defenders.
These are the only ones of the games Matt mentioned changes in
that I've got in my arsenal, so I can not vouch for the rest.
Oh, and of course a full piglit run with no changes reported.

There's a nice improvement to Dota2 due to patch 2 which,
as suggested by Ian, also fixes the Brutal Legend regression :)

I've resolved undefined behaviour in operations like pow, log,
sqrt, etc to emit bounds corresponding to a constant zero.
I'm also working on a pass to replace undefined behaviour
in these operations with a constant zero.

Some of the additions I've made to get-range operate vector-wise.
It would probably be benefitial to operate component-wise.
It should allow more constants to be folded/prop. up the tree
which would be a benefit at least for scalar backends?
I'm still putting together a tactic on how to do this so
if there's any good suggestions then please speak out.

For copyright header on the ir_constant_util.h file I basically
copy-pasted the license header from opt_algebraic.
The rationale was that the code itself was a copy-pasta from here
with no real additions from my side.
Is this an acceptable approach?

CC: Matt Turner <mattst88 at gmail.com>
CC: Ian Romanick <idr at freedesktop.org>

Thomas Helland (16):
  glsl: Add EmitNoSaturate to shader compiler options
  glsl: Reorder optimization-passes
  glsl: Move common code to ir_constant_util.h
  glsl: Expand constant_util
  glsl: Change to using switch-case in get_range
  glsl: Add sin, cos and sign to get_range
  glsl: Add saturate to get_range
  glsl: Add abs to get_range
  glsl: Add sqrt, rsq, exp, exp2 to get_range
  glsl: Add ir_binop_add to get_range
  glsl: Add ir_binop_pow to get_range
  glsl: Add log and log2 to get_range
  glsl: Add ir_binop_sub to get_range
  glsl: Add ir_binop_mul to get_range
  glsl: Add ir_unop_neg to get_range
  glsl: Add ir_unop_rcp to get_range

 src/glsl/glsl_parser_extras.cpp |   2 +-
 src/glsl/ir_constant_util.h     | 172 ++++++++++++++++++++++++++++++++++++
 src/glsl/opt_algebraic.cpp      | 100 +++------------------
 src/glsl/opt_minmax.cpp         | 191 +++++++++++++++++++++++++++++++++++-----
 src/mesa/main/mtypes.h          |   1 +
 5 files changed, 357 insertions(+), 109 deletions(-)
 create mode 100644 src/glsl/ir_constant_util.h

-- 
2.0.3



More information about the mesa-dev mailing list