Opened 3 years ago

Closed 3 years ago

#4670 closed enhancement (fixed)

[PATCH] update mesa software renderers detection

Reported by: fabio Owned by: elexis
Priority: Nice to Have Milestone: Alpha 22
Component: Core engine Keywords: patch
Cc: Patch:

Description

hwdetect.js has a way to detect mesa software renderers. As of this mesa commit the "Gallium 0.4 on" prefix was removed.

This patch add support for mesa after that commit:

-    if (GL_RENDERER.match(/^(Software Rasterizer|Gallium \S* on (llvm|soft)pipe.*|Mesa X11|Apple Software Renderer|GDI Generic)$/))
+    if (GL_RENDERER.match(/^(Software Rasterizer|.*(llvm|soft)pipe.*|Mesa X11|Apple Software Renderer|GDI Generic)$/))

Feel free to push it for a22 (it should do no harm), I cannot do a proper patch right now, or delay to a later release (not so urgent as this only impacts the few users using a slow mesa software renderer).

Attachments (1)

hwdetect.patch (917 bytes ) - added by elexis 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by elexis, 3 years ago

Pros: In the referenced commit, we see Gallium %s on %s being removed and now only the second %s variable being returned.

In the proposed patch, we exactly see Gallium \S* on removed, so it exactly matches that commit. The patch is complete because Gallium doesn't occur anywhere else in binaries/data/mods/mod.

The patch doesn't have any side-effects (false positive detection),

However: I don't know which strings are actually intended to match. Maybe the list needs extension.

We can usehttps://regex101.com/ and match it against the some example strings.

The one in the commit fails in both cases:

/^(Software Rasterizer|Gallium \S* on (llvm|soft)pipe.*|Mesa X11|Apple Software Renderer|GDI Generic)$/
/^(Software Rasterizer|.*(llvm|soft)pipe.*|Mesa X11|Apple Software Renderer|GDI Generic)$/
Gallium 0.4 on AMD Radeon R9 Fury Series (DRM 3.17.0 / 4.11.0-staging-01277-gab25a9e, LLVM 5.0.0)

and we see the string would have to be Gallium foo on llvmpipe or something like that, which however does exist according to some user reports in the www.

So committing the patch would improve and probably not add false positives.

by elexis, 3 years ago

Attachment: hwdetect.patch added

comment:2 by elexis, 3 years ago

The code was added in r9305 to disable shadows for that hardware (#623),
extended in r11660 and
consolidated in r17339.

Reading #623, this just seems to be a database which maps arbitrary strings to setting restrictions. So the code has to be maintained and updated frequently, which means we don't really have to check for (database) completion.

Also echotangoecho gave a thumbs up.

fabio how did you find out about this string change?
Do you (still) use that hardware and tested the patch with actual 0ad?

comment:3 by fabio, 3 years ago

I had a look at mesa commits and noticed that change. It is not a real hardware, it's a software renderer and can be tested on Linux setting this variable LIBGL_ALWAYS_SOFTWARE=1

I didn't test it, I cannot right now, but the change really looks straightforward.

About the database in hwdetect, they are mostly for old hardware/drivers, everything is enabled when using recent hardware supporting OpenGL 4+. A cleanup would be nice though, iirc there is a patch on phabricator.

comment:4 by elexis, 3 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 19886:

Update Mesa software renderer detection.

Fixes #4670
Refs #623, D86, https://cgit.freedesktop.org/mesa/mesa/commit/?id=92b4ca45504e7ffc5f4fa385ada1be48e6123181
Patch By: fabio

Note: See TracTickets for help on using tickets.