Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: Optimizing Mesa Performance With Compiler Flags

  1. #21
    Join Date
    Oct 2008
    Posts
    3,137

    Default

    Quote Originally Posted by nej_simon View Post
    Then why not use something like -march=i686 -msse -msse2? That would enable gcc to use cmov and sse/sse2 instructions and the binaries would still run on a P4.
    The v2 patch now has these options, and will almost certainly get approved.

    -march=pentium4 -mtune=core2 -mfpmath=sse


    Actually that looks like a typo - the patch comments talk about sse2, but the patch itself just enables sse.
    Last edited by smitty3268; 01-28-2013 at 11:09 PM.

  2. #22
    Join Date
    Oct 2008
    Posts
    3,137

    Default

    Quote Originally Posted by mark_ View Post
    ok, makes sense. But shouldn't the programmer use inline functions or macros in this case?
    I guess I will add the inline parameter to my CXXFLAGs and for single C packages.
    Function inlining varies a lot between software. In some cases, it gives huge speedups. Other times, it just results in slower performance and greater memory use. It can vary depending on how large your CPU cache is as well.

    You can even manually set the depth the compiler will inline down to - something Firefox does for example, because the default -O3 inlining was too much, but by limiting the inlining amount they could still turn on -O3 and get better results than plain old -O2.

  3. #23
    Join Date
    Oct 2008
    Posts
    3,137

    Default

    Quote Originally Posted by Adarion View Post
    Question is indeed if mesa is speed limiting step (aka bottleneck) in the whole system here. But it won't hurt to keep my Gentoo CFLAGS like they are. Mainly march set and -O2. In few cases I actually use -Os for VIA CPUs or AMD's old Geode LX. Few packages might dislike messing too much with CFLAGS though.
    It's much more likely to be with faster GPUs and lower resolutions. Michael testing an IGP at 1080p probably isn't going to show a lot.

  4. #24
    Join Date
    Aug 2011
    Location
    Hillsboro, Oregon
    Posts
    136

    Default

    Quote Originally Posted by Lockal View Post
    I guess the bottleneck of most videogames is not OpenGL, unless the game is designed for high-end graphics card. Check this with any profiler: gl... calls are almost unnoticeable amoung game physics and logic. Compiling the actual software and main libraries instead of driver could give a very different result.
    Not in my experience. I've run a lot of benchmarks and games, and 'sysprof' often shows that _mesa_* calls (which are the actual implementation of the gl* calls) are a very noticable percentage.

  5. #25
    Join Date
    Feb 2008
    Location
    Linuxland
    Posts
    5,108

    Default

    I've always* built Mesa with -O3 and not once had an issue that was because of that.

    * not built git in the last 3-4 months since it requires newer autofoo and I'm too lazy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •