xref: /aosp_15_r20/external/mesa3d/docs/application-issues.rst (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard WorkerApplication Issues
2*61046927SAndroid Build Coastguard Worker==================
3*61046927SAndroid Build Coastguard Worker
4*61046927SAndroid Build Coastguard WorkerThis page documents known issues with some OpenGL applications.
5*61046927SAndroid Build Coastguard Worker
6*61046927SAndroid Build Coastguard WorkerTopogun
7*61046927SAndroid Build Coastguard Worker-------
8*61046927SAndroid Build Coastguard Worker
9*61046927SAndroid Build Coastguard Worker`Topogun <https://www.topogun.com/>`__ for Linux (version 2, at least)
10*61046927SAndroid Build Coastguard Workercreates a GLX visual without requesting a depth buffer. This causes bad
11*61046927SAndroid Build Coastguard Workerrendering if the OpenGL driver happens to choose a visual without a
12*61046927SAndroid Build Coastguard Workerdepth buffer.
13*61046927SAndroid Build Coastguard Worker
14*61046927SAndroid Build Coastguard WorkerMesa 9.1.2 and later (will) support a DRI configuration option to work
15*61046927SAndroid Build Coastguard Workeraround this issue. Using the
16*61046927SAndroid Build Coastguard Worker`driconf <https://dri.freedesktop.org/wiki/DriConf>`__ tool, set the
17*61046927SAndroid Build Coastguard Worker"Create all visuals with a depth buffer" option before running Topogun.
18*61046927SAndroid Build Coastguard WorkerThen, all GLX visuals will be created with a depth buffer.
19*61046927SAndroid Build Coastguard Worker
20*61046927SAndroid Build Coastguard WorkerOld OpenGL games
21*61046927SAndroid Build Coastguard Worker----------------
22*61046927SAndroid Build Coastguard Worker
23*61046927SAndroid Build Coastguard WorkerSome old OpenGL games (approx. ten years or older) may crash during
24*61046927SAndroid Build Coastguard Workerstart-up because of an extension string buffer-overflow problem.
25*61046927SAndroid Build Coastguard Worker
26*61046927SAndroid Build Coastguard WorkerThe problem is a modern OpenGL driver will return a very long string for
27*61046927SAndroid Build Coastguard Workerthe ``glGetString(GL_EXTENSIONS)`` query and if the application naively
28*61046927SAndroid Build Coastguard Workercopies the string into a fixed-size buffer it can overflow the buffer
29*61046927SAndroid Build Coastguard Workerand crash the application.
30*61046927SAndroid Build Coastguard Worker
31*61046927SAndroid Build Coastguard WorkerThe work-around is to set the ``MESA_EXTENSION_MAX_YEAR`` environment
32*61046927SAndroid Build Coastguard Workervariable to the approximate release year of the game. This will cause
33*61046927SAndroid Build Coastguard Workerthe ``glGetString(GL_EXTENSIONS)`` query to only report extensions older
34*61046927SAndroid Build Coastguard Workerthan the given year.
35*61046927SAndroid Build Coastguard Worker
36*61046927SAndroid Build Coastguard WorkerFor example, if the game was released in 2001, do
37*61046927SAndroid Build Coastguard Worker
38*61046927SAndroid Build Coastguard Worker.. code-block:: sh
39*61046927SAndroid Build Coastguard Worker
40*61046927SAndroid Build Coastguard Worker   export MESA_EXTENSION_MAX_YEAR=2001
41*61046927SAndroid Build Coastguard Worker
42*61046927SAndroid Build Coastguard Workerbefore running the game.
43*61046927SAndroid Build Coastguard Worker
44*61046927SAndroid Build Coastguard WorkerViewperf
45*61046927SAndroid Build Coastguard Worker--------
46*61046927SAndroid Build Coastguard Worker
47*61046927SAndroid Build Coastguard WorkerSee the :doc:`Viewperf issues <viewperf>` page for a detailed list of
48*61046927SAndroid Build Coastguard WorkerViewperf issues.
49