mesa/src/gallium/docs/source
José Fonseca 50b3fc6204 gallium: Disambiguate TGSI_OPCODE_IF.
TGSI_OPCODE_IF condition had two possible interpretations:

- src.x != 0.0f

  - Mesa statetracker when PIPE_SHADER_CAP_INTEGERS was false either for
    vertex and fragment shaders
  - gallivm/llvmpipe
  - postprocess
  - vl state tracker
  - vega state tracker
  - most old drivers
  - old internal state trackers
  - many graw examples

- src.x != 0U

  - Mesa statetracker when PIPE_SHADER_CAP_INTEGERS was true for both
    vertex and fragment shaders
  - tgsi_exec/softpipe
  - r600
  - radeonsi
  - nv50

And drivers that use draw module also were a mess (because Mesa would
emit float IFs, but draw module supports native integers so it would
interpret IF arg as integers...)

This sort of works if the source argument is limited to float +0.0f or
+1.0f, integer 0, but would fail if source is float -0.0f, or integer in
the float NaN range.  It could also fail if source is integer 1, and
hardware flushes denormalized numbers to zero.

But with this change there are now two opcodes, IF and UIF, with clear
meaning.

Drivers that do not support native integers do not need to worry about
UIF.  However, for backwards compatibility with old state trackers and
examples, it is advisable that native integer capable drivers also
support the float IF opcode.

I tried to implement this for r600 and radeonsi based on the surrounding
code.  I couldn't do this for nouveau, so I just shunted IF/UIF
together, which matches the current behavior.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>

v2:
- Incorporate Roland's feedback.
- Fix r600_shader.c merge conflict.
- Fix typo in radeon, spotted by Michel Dänzer.
- Incorporte  Christoph Bumiller's patch to handle TGSI_OPCODE_IF(float)
  properly in nv50/ir.
2013-04-17 10:54:08 +01:00
..
cso gallium: add TGSI_SEMANTIC_TEXCOORD,PCOORD v3 2013-03-20 12:25:21 +01:00
exts gallium/docs: Add formatting for envvar role; change debugging. 2010-08-15 03:43:54 -07:00
conf.py gallium/docs: update some distro information 2012-10-15 16:11:49 +02:00
context.rst gallium/docs: fix definition of PIPE_QUERY_SO_STATISTICS 2013-04-03 12:54:43 +02:00
cso.rst Fill out some of the CSO info. 2009-12-20 16:40:39 -08:00
debugging.rst freedreno: document debug flag 2013-04-04 10:41:50 -06:00
distro.rst gallium/docs: update some distro information 2012-10-15 16:11:49 +02:00
glossary.rst gallium: support for array textures and related changes 2010-12-02 04:33:43 +01:00
index.rst gallium: add PIPE_TEXTURE_RECT target 2010-08-20 12:03:59 +02:00
intro.rst Add Gallium docs. 2009-12-20 15:00:40 -08:00
pipeline.txt gallium/docs: added new pipeline.txt diagram 2010-09-17 18:50:47 -06:00
resources.rst gallium/docs: improve text about resources a bit. 2013-02-22 04:34:07 +01:00
screen.rst gallium: PIPE_COMPUTE_CAP_IR_TARGET - allow drivers to specify a processor v2 2013-04-05 18:43:34 -04:00
tgsi.rst gallium: Disambiguate TGSI_OPCODE_IF. 2013-04-17 10:54:08 +01:00