mesamatrix
mesamatrix copied to clipboard
Generate the feature list using mesa C code
As said by @mirh in his https://github.com/MightyCreak/mesamatrix/pull/149#issuecomment-516082900, it might be possible to scrap the information directly from the mesa C code instead of features.txt.
If possible, it would be nice to generate a formatted text file by running a command with a binary compiled with mesa's code.
The idea would be to call the functions that set the extension flags, like this one for intel: intelInitExtensions.
Right now, I don't know if it's possible to get all the wanted information this way. It would need more investigation.
That would also allow to have per-generation information about extensions.
For the record: there is also gpuinfo
And there's also glxinfo. They are all tools that run empirically on real hardware though, which is quite different than this.
For the record (again): Here Rob Clark suggests to use a CI pipeline to run glxinfo to retrieve the driver's capabilities.
AFAIK the hardware just reports what the driver tells him to. I'm not aware of any information other than the model number that you dynamically query.
It would certainly be easier because you just have to dump information that most of times is already easily pipelined (grep glxinfo, don't you?).. Still it kinda seems to miss the point here.
@sehraf as @mirh said, glxinfo will only tell what the machine is currently running. A CI pipeline would work, but AFAIK you would need to have at least as many machines as you have drivers, and probably more if you want to test the GPU generations within these drivers.
Although it sounds like a pretty interesting project to set up, I don't have the resources (both time and money) to do it.
I'm secretly hoping someone comes up w/ a way to generate features.txt (at least for drivers w/ drm_shim support) by running glxinfo in CI
I have no idea what drm_shim is but to me it sounds like this would be independent of hardware/machine.
The advantage of CI is that you can have as many "machines" as you need. Also this would allow to automatically update features.txt with each commit.
I've asked the question on the freedesktop thread about what is drm_shim and Rob answered this:
They are an $LD_PRELOAD'd thing to spoof enough of the kernel uabi to "run" the driver. Ie. you can't actually do drawing, but it is enough to run shader-db. And so I think it should be pretty much enough to run glxinfo.
So.. maybe it's doable, but apparently there are only 2 drivers supporting drm-shim for now: boradcom and freedreno. I've asked if there are more.
Parsing source code still seems exponentially less wasteful (for as much as instead, there is more complexity in the code to write)