Mesa3D Graphics Library (Bleeding edge ray tracing branches)
Go to file
Eric Anholt d845dca0f5 nir: Make algebraic backtrack and reprocess after a replacement.
The algebraic pass was exhibiting O(n^2) behavior in
dEQP-GLES2.functional.uniform_api.random.3 and
dEQP-GLES31.functional.ubo.random.all_per_block_buffers.13 (along with
other code-generated tests, and likely real-world loop-unroll cases).
In the process of using fmul(b2f(x), b2f(x)) -> b2f(iand(x, y)) to
transform:

result = b2f(a == b);
result *= b2f(c == d);
...
result *= b2f(z == w);

->

temp = (a == b)
temp = temp && (c == d)
...
temp = temp && (z == w)
result = b2f(temp);

nir_opt_algebraic, proceeding bottom-to-top, would match and convert
the top-most fmul(b2f(), b2f()) case each time, leaving the new b2f to
be matched by the next fmul down on the next time algebraic got run by
the optimization loop.

Back in 2016 in 7be8d07732 ("nir: Do opt_algebraic in reverse
order."), Matt changed algebraic to go bottom-to-top so that we would
match the biggest patterns first.  This helped his cases, but I
believe introduced this failure mode.  Instead of reverting that, now
that we've got the automaton, we can update the automaton's state
recursively and just re-process any instructions whose state has
changed (indicating that they might match new things).  There's a
small chance that the state will hash to the same value and miss out
on this round of algebraic, but this seems to be good enough to fix
dEQP.

Effects with NIR_VALIDATE=0 (improvement is better with validation enabled):

Intel shader-db runtime -0.954712% +/- 0.333844% (n=44/46, obvious throttling
  outliers removed)
dEQP-GLES2.functional.uniform_api.random.3 runtime
  -65.3512% +/- 4.22369% (n=21, was 1.4s)
dEQP-GLES31.functional.ubo.random.all_per_block_buffers.13 runtime
  -68.8066% +/- 6.49523% (was 4.8s)

v2: Use two worklists, suggested by @cwabbott, to cut out a bunch of
    tricky code.  Runtime of uniform_api.random.3 down -0.790299% +/-
    0.244213% compred to v1.
v3: Re-add the nir_instr_remove() that I accidentally dropped in v2,
    fixing infinite loops.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2019-11-26 10:13:46 -08:00
.appveyor Appveyor: Quickly fix meson build. 2019-11-14 21:45:23 +00:00
.gitlab-ci llvmpipe: initial query buffer object support. (v2) 2019-11-25 12:37:32 +10:00
bin meson: add windows support to symbols checks 2019-11-05 20:31:37 +00:00
build-support
docs docs: add llvmpipe to ARB_query_buffer_object. 2019-11-25 12:37:58 +10:00
doxygen
include vulkan: Update the XML and headers to 1.1.129 2019-11-26 02:48:42 +00:00
scons mesa/imports: let the build system detect strtok_r() 2019-11-05 22:38:04 +00:00
src nir: Make algebraic backtrack and reprocess after a replacement. 2019-11-26 10:13:46 -08:00
subprojects meson: add a expat subproject 2019-09-10 20:36:47 +00:00
.dir-locals.el
.editorconfig editorconfig: Fix meson style 2019-05-24 18:44:18 +00:00
.gitignore intel/tools: Add unit tests for assembler 2019-05-07 14:33:48 -07:00
.gitlab-ci.yml gitlab-ci/deqp: generate junit results 2019-11-22 13:48:29 -08:00
.mailmap .mailmap: add a couple of aliases for Jakob Bornecrantz 2019-10-03 17:11:20 -04:00
.travis.yml travis: fix scons build after deprecation warning 2019-10-29 09:25:40 +00:00
Android.common.mk android: mesa: Revert "android: mesa: revert "Enable asm unconditionally"" 2019-11-12 18:09:43 +00:00
Android.mk android: mesa: Revert "android: mesa: revert "Enable asm unconditionally"" 2019-11-12 18:09:43 +00:00
CleanSpec.mk CleanSpec.mk: Remove HOST_OUT_release 2018-08-02 15:42:40 -06:00
README.rst README: Drop the badges from the readme 2019-02-07 12:46:17 -06:00
REVIEWERS REVIEWERS: add VMware reviewers 2019-10-18 16:42:40 +00:00
SConstruct scons: Fix force_scons parsing. 2019-10-26 08:23:48 +01:00
VERSION Bump VERSION to 20.0.0-devel 2019-10-30 14:56:02 -07:00
appveyor.yml Appveyor: Quickly fix meson build. 2019-11-14 21:45:23 +00:00
common.py scons: Print a deprecation warning about using scons on not windows 2019-10-24 18:33:50 +00:00
meson.build meson: only build imgui when needed 2019-11-25 07:51:56 +00:00
meson_options.txt util: Use ZSTD for shader cache if possible 2019-11-11 18:53:45 +00:00

README.rst

`Mesa <https://mesa3d.org>`_ - The 3D Graphics Library
======================================================


Source
------

This repository lives at https://gitlab.freedesktop.org/mesa/mesa.
Other repositories are likely forks, and code found there is not supported.


Build & install
---------------

You can find more information in our documentation (`docs/install.html
<https://mesa3d.org/install.html>`_), but the recommended way is to use
Meson (`docs/meson.html <https://mesa3d.org/meson.html>`_):

.. code-block:: sh

  $ mkdir build
  $ cd build
  $ meson ..
  $ sudo ninja install


Support
-------

Many Mesa devs hang on IRC; if you're not sure which channel is
appropriate, you should ask your question on `Freenode's #dri-devel
<irc://chat.freenode.net#dri-devel>`_, someone will redirect you if
necessary.
Remember that not everyone is in the same timezone as you, so it might
take a while before someone qualified sees your question.
To figure out who you're talking to, or which nick to ping for your
question, check out `Who's Who on IRC
<https://dri.freedesktop.org/wiki/WhosWho/>`_.

The next best option is to ask your question in an email to the
mailing lists: `mesa-dev\@lists.freedesktop.org
<https://lists.freedesktop.org/mailman/listinfo/mesa-dev>`_


Bug reports
-----------

If you think something isn't working properly, please file a bug report
(`docs/bugs.html <https://mesa3d.org/bugs.html>`_).


Contributing
------------

Contributions are welcome, and step-by-step instructions can be found in our
documentation (`docs/submittingpatches.html
<https://mesa3d.org/submittingpatches.html>`_).

Note that Mesa uses email mailing-lists for patches submission, review and
discussions.