Mesa3D Graphics Library (Bleeding edge ray tracing branches)
Go to file
Kenneth Graunke f45dd6d31b st/mesa: Limit GL_MAX_[NATIVE_]PROGRAM_PARAMETERS_ARB to 2048
Piglit's vp-max-array test creates a vertex program containing a uniform
array sized to the value of GL_MAX_NATIVE_PROGRAM_PARAMETERS_ARB.  Mesa
will then add additional state-var parameters for things like the MVP
matrix.

radeonsi currently exposes a value of 4096, derived from constant buffer
upload size.  This means the array will have 4096 elements, and the
extra MVP state-vars would get a prog_src_register::Index of over 4096.

Unfortunately, prog_src_register::Index is a signed 13-bit integer, so
values beyond 4096 end up turning into negative numbers.  Negative
source indexes are only valid for relative addressing, so this ends up
generating illegal IR.

In prog_to_nir, this would cause an out of bounds array access.
st_mesa_to_tgsi checks for a negative value, assumes it's bogus,
and remaps it to parameter 0 in order to get something in-range.
This isn't right - instead of reading the MVP matrix, it would read
the first element of the vertex program's large array.  But the test
only checks that the program compiles, so we never noticed that it
was broken.

This patch limits the size of the program limits, with the understanding
that we may need to generate additional state-vars internally.  i965 has
exposed 1024 for this limit for years, so I don't expect lowering it to
2048 will cause any practical problems for radeonsi or other drivers.

Fixes vp-max-array with prog_to_nir.c.

Cc: "19.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-02-11 21:09:51 -08:00
.gitlab-ci gitlab-ci: add meson glvnd build 2019-02-06 17:56:30 +00:00
bin meson: add script to print the options before configuring a builddir 2019-02-07 13:22:41 +00:00
build-support configure: commit test files 2017-10-16 16:32:43 -07:00
docs docs: update qbo support for virgl 2019-02-08 09:06:36 +10:00
doxygen doxygen: Plumb through gallium/ to automated documentation 2016-05-30 17:53:45 +01:00
include intel: Add more PCI Device IDs for Coffee Lake and Ice Lake. 2019-02-04 10:05:25 -08:00
m4 configure: allow building with python3 2018-10-31 19:15:50 +00:00
scons scons: drop unused HAVE_STDINT_H macro 2018-10-30 18:10:59 +00:00
scripts appveyor: Revert commits adding Cygwin support. 2019-01-25 14:13:26 +00:00
src st/mesa: Limit GL_MAX_[NATIVE_]PROGRAM_PARAMETERS_ARB to 2048 2019-02-11 21:09:51 -08:00
.dir-locals.el dir-locals.el: Adds White Space support 2016-11-14 19:17:49 +02:00
.editorconfig editorconfig: Add max_line_length property 2019-01-10 15:50:34 +02:00
.gitattributes
.gitignore .gitignore: list *.orig and *.rej 2017-09-06 17:48:50 +01:00
.gitlab-ci.yml gitlab-ci: Re-use docker image from the main repo in forked repos 2019-02-11 12:24:31 +01:00
.mailmap mailmap: add various typos of Emil's address from the log 2018-08-16 17:38:04 +01:00
.travis.yml travis: fix osx make build 2019-02-07 20:14:14 +00:00
Android.common.mk build: stop defining unused VERSION 2018-11-26 22:05:02 +00:00
Android.mk Switch imx to kmsro and remove the imx winsys 2019-01-28 11:50:08 -06:00
CleanSpec.mk CleanSpec.mk: Remove HOST_OUT_release 2018-08-02 15:42:40 -06:00
Makefile.am automake: Add --enable-autotools to distcheck flags 2019-01-30 19:32:44 +00:00
README.rst README: Drop the badges from the readme 2019-02-07 12:46:17 -06:00
REVIEWERS REVIEWERS: add Vulkan reviewer group 2018-11-13 17:25:02 +00:00
SConstruct scons: Require python 2.7 2018-08-16 13:52:56 -07:00
VERSION bump version for 19.0 branch 2019-01-29 15:30:25 -08:00
appveyor.yml appveyor: Revert commits adding Cygwin support. 2019-01-25 14:13:26 +00:00
autogen.sh
common.py scons/svga: remove opt from the list of valid build types 2018-10-26 12:09:00 -06:00
configure.ac Switch imx to kmsro and remove the imx winsys 2019-01-28 11:50:08 -06:00
install-gallium-links.mk gallium: Fix install-gallium-links.mk on non-bash /bin/sh 2016-10-10 08:56:12 -07:00
install-lib-links.mk
meson.build meson: Remove panfrost from default driver list 2019-02-06 02:59:00 +00:00
meson_options.txt panfrost: Initial stub for Panfrost driver 2019-02-05 01:19:30 +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.