Mesa3D Graphics Library (Bleeding edge ray tracing branches)
Go to file
Jason Ekstrand 1b8a43a0ba util: Remove util_cpu_detect
util_cpu_detect is an anti-pattern: it relies on callers high up in the call
chain initializing a local implementation detail. As a real example, I added:

...a Mali compiler unit test
...that called bi_imm_f16() to construct an FP16 immediate
...that calls _mesa_float_to_half internally
...that calls util_get_cpu_caps internally, but only on x86_64!
...that relies on util_cpu_detect having been called before.

As a consequence, this unit test:

...crashes on x86_64 with USE_X86_64_ASM set
...passes on every other architecture
...works on my local arm64 workstation and on my test board
...failed CI which runs on x86_64
...needed to have a random util_cpu_detect() call sprinkled in.

This is a bad design decision. It pollutes the tree with magic, it causes
mysterious CI failures especially for non-x86_64 developers, and it is not
justified by a micro-optimization.

Instead, let's call util_cpu_detect directly from util_get_cpu_caps, avoiding
the footgun where it fails to be called.  This cleans up Mesa's design,
simplifies the tree, and avoids a class of a (possibly platform-specific)
failures. To mitigate the added overhead, wrap it all in a (fast) atomic
load check and declare the whole thing as ATTRIBUTE_CONST so the
compiler will CSE calls to util_cpu_detect.

Co-authored-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15580>
2022-04-20 18:44:35 +00:00
.gitlab/issue_templates issue_templates/Bug Report: Rename master branch to main 2021-05-05 12:20:11 -07:00
.gitlab-ci dzn/ci: Don't spam conformance warnings 2022-04-20 14:52:40 +00:00
android gallium/swr: Remove common code and build options 2021-12-06 23:37:50 +00:00
bin win32: Fixes 32 bits visual studio module definition files by add script gen_vs_module_defs.py 2022-04-19 19:38:47 +00:00
build-support
docs v3d: enable GL_ARB_copy_image extension 2022-04-19 08:03:42 +00:00
include intel/dev: Add ATS-M pci-ids 2022-04-08 17:48:13 +00:00
src util: Remove util_cpu_detect 2022-04-20 18:44:35 +00:00
subprojects meson: Update libelf wrap for Windows 2021-11-12 09:46:10 +00:00
.dir-locals.el
.editorconfig editorconfig: Use 3-space tabs for .rst 2021-06-22 17:37:55 +00:00
.gitattributes Add new rules to .gitattributes 2022-01-19 15:17:17 +00:00
.gitignore intel/tools: Add unit tests for assembler 2019-05-07 14:33:48 -07:00
.gitlab-ci.yml Revert "ci: Disable Google's lab" 2022-04-14 22:01:27 +00:00
.mailmap .mailmap: Switch Jason Ekstrand to @collabora.com 2022-01-26 20:08:31 +00:00
.travis.yml travis: Download XQuartz from GitHub. 2021-05-29 10:25:16 +00:00
CODEOWNERS ci: add Broadcom CI maintainer 2022-04-12 10:42:31 +00:00
README.rst docs: promote #dri-devel on oftc over freenode 2021-05-24 09:21:48 +00:00
VERSION VERSION: bump to 22.2-devel for next cycle 2022-04-13 23:40:25 +00:00
meson.build meson: turn on -Wno-unused-function project-wide 2022-04-19 06:54:47 +00:00
meson_options.txt Use proper types for meson objects 2022-04-18 13:03:08 +03: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.rst
<https://mesa3d.org/install.html>`_), but the recommended way is to use
Meson (`docs/meson.rst <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 `OFTC's #dri-devel
<irc://irc.oftc.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.rst <https://mesa3d.org/bugs.html>`_).


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

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

Note that Mesa uses gitlab for patches submission, review and discussions.