[Mesa-dev] [PATCH v4 00/10] Add precise/invariant semantics to TGSI

Karol Herbst karolherbst at gmail.com
Fri Jun 23 18:30:19 UTC 2017


Running Tomb Raider on Nouveau I found some flicker caused by ignoring precise
modifiers on variables inside Nouveau.

This series add precise/invariant handling to TGSI, which can be then used by
drivers to disable certain unsafe optimisations which may otherwise alter
calculations, which depend on having the same result across shaders.

This series fixes this bug in Tomb Raider and one CTS test for 4.4 and 4.5

No piglit regression on my nve6

Changes since v3:
* more documentation
* don't disable SAD opt for nv50
* bug fixes

Karol Herbst (10):
  tgsi: add precise flag to tgsi_instruction
  tgsi/dump: print _PRECISE modifier on Instructions
  st/glsl_to_tgsi: handle precise modifier
  tgsi: populate precise
  tgsi/text: parse _PRECISE modifier
  gallium/docs: add precise instruction modifier
  st/glsl_to_tgsi: don't optimize mul+add to mad if expression is
    precise
  nv50/ir: add precise field to Instruction
  nv50/ir/tgsi: handle precise for most ALU instructions
  nv50/ir: disable mul+add to mad for precise instructions

 src/gallium/auxiliary/tgsi/tgsi_build.c            |  4 +++
 src/gallium/auxiliary/tgsi/tgsi_dump.c             |  4 +++
 src/gallium/auxiliary/tgsi/tgsi_text.c             | 17 ++++++++--
 src/gallium/auxiliary/tgsi/tgsi_ureg.c             |  8 ++++-
 src/gallium/auxiliary/tgsi/tgsi_ureg.h             | 14 ++++++++-
 src/gallium/auxiliary/util/u_simple_shaders.c      |  2 +-
 src/gallium/docs/source/tgsi.rst                   | 11 ++++++-
 src/gallium/drivers/nouveau/codegen/nv50_ir.cpp    |  1 +
 src/gallium/drivers/nouveau/codegen/nv50_ir.h      |  1 +
 .../drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp  |  2 ++
 .../drivers/nouveau/codegen/nv50_ir_peephole.cpp   |  5 +--
 src/gallium/include/pipe/p_shader_tokens.h         |  3 +-
 src/gallium/state_trackers/nine/nine_shader.c      |  6 ++--
 src/mesa/state_tracker/st_atifs_to_tgsi.c          | 36 +++++++++++-----------
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp         | 21 ++++++++++---
 src/mesa/state_tracker/st_mesa_to_tgsi.c           |  6 ++--
 16 files changed, 103 insertions(+), 38 deletions(-)

-- 
2.13.1



More information about the mesa-dev mailing list