1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

Mesa's IR Might Get Changed Around Amid Discussions

Mesa

Published on 29 May 2014 11:19 AM EDT
Written by Michael Larabel in Mesa
5 Comments

In a new mailing list thread, Eric Anholt expresses regrets a few years ago when they began sending GLSL IR into their driver rather than using Mesa IR and improving that intermediate representation. Eric is now trying to get the Mesa IR support up to scratch so that it can be sent directly to classic Mesa drivers.

Eric Anholt of Intel's Open-Source Technology Center wrote:
Here's a series I started back in January as a little experiment. Basically, I feel guilty for pushing GLSL IR into the driver, and wish I'd just fixed up Mesa IR back in the day. But, given that we're still feeding Mesa IR into drivers as well (ARB programs and fixed function vertex programs), it made me think: What if I fixed it up now, and got Mesa IR to the point that we could just garbage collect the GLSL IR input paths to drivers?

Mesa IR has a bunch of weaknesses that need to get sorted out if it's going to be useful:

- It's a single giant array of instructions, making modifications of the instruction stream (instruction lowering, optimization, etc.) more expensive in code and CPU time than it should be.
- It doesn't have any variable declarations, so if you have dynamic array indexing, optimization just shuts down (plus, no annotation on the temps, so debugging is irritating).
- It doesn't have integer instructions or anything else post-GLSL-1.30.
- The optimization passes for it are totally ad-hoc and fairly weak.
- It's not SSA.

I'm interested in fixing all of these. How do people feel about this goal?

This series fixes the first bullet point above. Patch 15 is huge, but I didn't see a way to chop it up smaller without maintaining the list alongside the array for some intermediate patches. I'd be willing to do so if needed, though, to make review doable. You can also find the changes in the "mesa-ir" branch of my git tree.

In response fellow Intel OTC developer Ian Romanick expressed concerns that this change would regress other old Mesa drivers like ATI R200 and the i915 drivers where they seldom see new work, testing, etc. It's also a bit like reinventing TGSI, the intermediate representation used by Gallium3D drivers. "I'm not very excited about exposing i915, r200, and swrast to more potential breakage that nobody will notice until 5 minutes before a release... or 5 mintues after. Not wanting to touch prog_exec is one of the reasons we avoided making changes to Mesa IR in the first place. It also feels a bit like a re-invention of TGSI, and nobody seems particularly enamored with that IR either. That said, it may still be an interesting experiment."

Open-source contributor Connor Abbott also expressed some reservations about the proposed change and 16 initial patches. "I don't know much about Mesa IR, but this seems like a huge pile of work... is this any easier than just making GLSL IR flatter, like with my flatland idea that I posted a while ago? Also, iirc, there was an effort a while ago to make ARB programs go through GLSL IR but it was abandoned - why was it so difficult? I'm skeptical that basically bringing an older IR from 1999 to 2014 is going to be less effort than modifying a newer one that had some good ideas and some bad ones."

Intel OTC developer Kenneth Graunke also expressed concerns. "I'm still really skeptical of this goal. I don't think reusing the existing Mesa IR backend code will save you much effort...Our Mesa IR adapters are missing features and have bad assumptions. For example, the VP code doesn't do texturing at all. The FP code assumes texture units/sampler units work like ARB programs. Neither do control flow at all. Neither do integer types. They also generate terrible code with piles of temporaries. You could fix all of these things, but it would entail writing a lot of code. And when you're done, you still have to throw the 'big switch' where you decide to use the new path instead of the GLSL IR path."

The discussion is still ongoing via this mailing list thread for those interested in GPU driver IR and Mesa.

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. Acer B286HK: A 28-inch UHD LED 4K Monitor For As Low As $350
  2. Intel Xeon E5-1680 v3 & E5-2687W v3 Compared To The Core i7 5960X On Linux
  3. Intel 120GB 530 Series SSD Linux Performance
  4. Btrfs/EXT4/XFS/F2FS RAID 0/1/5/6/10 Linux Benchmarks On Four SSDs
Latest Linux Articles
  1. Mesa Git Yields Performance Improvements For Newer AMD GPUs
  2. Apple OS X 10.10 vs. Ubuntu 14.10 Performance
  3. Mesa 10.5-devel Brings Some Intel Haswell HD Graphics Changes Over Mesa 10.3
  4. NVIDIA vs. Nouveau Drivers With Linux 3.18 + Mesa 10.4-devel
Latest Linux News
  1. Jolla Tablet Could Have MicroSDHC, Split Screen, 3.5G Upgrade
  2. Intel Has Last Round Of DRM Changes For Linux 3.19, Starts Dropping DRI1/UMS
  3. Fedora 21 Release Candidate 1 Awaits Your Testing
  4. GCC 5 Adds Support For ARM's Cortex-A17
  5. KWayland Server Component Coming For KDE Plasma 5.2
  6. NVIDIA Posts Tegra Gallium3D Patch For K1+ Support
  7. Ubuntu 14.10 MacBook Air Tests With Linux 3.18, Mesa 10.5
  8. AMD Richland APU Support Added To Coreboot
  9. 2014 Holiday Shopping Reminder, Happy Thanksgiving
  10. Python 3 Support Added To The GNOME Shell
Latest Forum Discussions
  1. Updated and Optimized Ubuntu Free Graphics Drivers
  2. Hurrican SDL Port
  3. Roadmap to Catalyst 14.10 ?
  4. how to configure module phoromatic ?
  5. PulseAudio 6.0 Is Coming & Other Linux Audio Plans For The Future
  6. Debian Developer Resigns From The Systemd Maintainership Team
  7. Cant get working Kaveri APU - A10-7850k
  8. Script for Fan Speed Control