Announcement

Collapse
No announcement yet.

Mesa Shader Compiler Cache Proposed, Reduces Game Start Times

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by smitty3268 View Post
    That's how you use the GL extension (ARB_get_program_binary), which is part of GL4.1. This patchset, however, does add an automatic cache that's used regardless of whether the apps ask for it or not, and isn't standard GL at all - just something extra that's easy to add on once you are able to do so. NVidia's driver does the same thing.
    When I launch these games, there is no cache created.

    Comment


    • #17
      Originally posted by whitecat View Post
      When I launch these games, there is no cache created.
      It looks like something is wrong, then.

      From the patch author:
      This series provides a disk cache for the shader compiler and is used
      to 'skip glLinkProgram' like GL_ARB_get_program_binary does but under
      the hood without api for the client.
      Looking at the code, i see in patch 18:

      int
      +mesa_program_diskcache_init(struct gl_context *ctx)
      +{
      + const char *tmp = "/tmp", *cache_root = NULL;
      + int result = 0;
      +
      + cache_root = _mesa_getenv("XDG_CACHE_DIR");
      + if (!cache_root)
      + cache_root = _mesa_getenv("HOME");
      + if (!cache_root)
      + cache_root = tmp;
      +
      + ctx->BinaryCachePath = ralloc_asprintf(ctx, "%s/.cache/mesa", cache_root);
      +
      + struct stat stat_info;
      + if (stat(ctx->BinaryCachePath, &stat_info) != 0)
      + result = mesa_mkdir_cache(ctx->BinaryCachePath);
      +
      + if (result == 0)
      + ctx->BinaryCacheActive = true;
      + else
      + ctx->BinaryCacheActive = false;
      +
      + return result;
      +}

      And then patch 19 goes on to call that function, and use the cache if the ctx->BinaryCacheActive is set to true.

      Maybe your application can't access whatever directory it's trying to use?
      Last edited by smitty3268; 06-04-2014, 08:22 PM.

      Comment


      • #18
        Originally posted by whitecat View Post
        When I launch these games, there is no cache created.
        Definitely something wrong then. I tried the patches with r600g some days ago and while many 3d applications crashed (Cairo-Dock, Steam, compton, ... sigsegv somewhere in r600g_dri.so), did a 2d fallback (xfce4-terminal, xfce4-panel, ...) or rendered garbage (Chromium) at least it created a cache:
        Code:
        $ ls ~/.cache/mesa
        12193688422293999815.bin  13610198304194110691.bin  349158879344228341.bin
        12193688423394689806.bin  1361019830831174043.bin   35282466041955907973.bin
        13328931782507786131.bin  1389218944831174043.bin   495130997817265084.bin
        13328931783394689806.bin  3218773652508479836.bin
        Please note that I didn't even start a game, just the desktop and Chromium.

        Comment


        • #19
          Originally posted by TAXI View Post
          Definitely something wrong then. I tried the patches with r600g some days ago and while many 3d applications crashed (Cairo-Dock, Steam, compton, ... sigsegv somewhere in r600g_dri.so), did a 2d fallback (xfce4-terminal, xfce4-panel, ...) or rendered garbage (Chromium) at least it created a cache:
          Code:
          $ ls ~/.cache/mesa
          12193688422293999815.bin  13610198304194110691.bin  349158879344228341.bin
          12193688423394689806.bin  1361019830831174043.bin   35282466041955907973.bin
          13328931782507786131.bin  1389218944831174043.bin   495130997817265084.bin
          13328931783394689806.bin  3218773652508479836.bin
          Please note that I didn't even start a game, just the desktop and Chromium.
          You can try the l4d2_testing branch, it fix the Steam crash.
          http://cgit.freedesktop.org/~tpalli/...h=l4d2_testing

          Comment


          • #20
            Originally posted by smitty3268 View Post
            Maybe your application can't access whatever directory it's trying to use?
            I don't think so. The cache is stored on HOME for me (I haven't the XDG_CACHE_DIR env var).
            Probably something is wrong since the author said it is not tested on gallium driver.

            Comment


            • #21
              Originally posted by whitecat View Post
              You can try the l4d2_testing branch, it fix the Steam crash.
              http://cgit.freedesktop.org/~tpalli/...h=l4d2_testing
              Maybe I'll try that later but my guess is that it might still not work. I think gallium and/or the r600g driver need some changes. Anyway with testing this I might be able to give Tapani Pälli a gdb backtrace which I think he still needs (I can't find any reply from Benjamin after that mail: http://lists.freedesktop.org/archive...ne/060663.html ), so I might really do it when I find the time for.

              Comment


              • #22
                Damn edit limit... Anyway: I tried the l4d2_testing branch and at least there don't seem to be any crashes. But there are rendering errors all over the place. It looks like these rendering issues begin as soon as the driver uses the cached shaders instead of compiling. Why does it look like that? Well, when I start some 3D application it works fine for the first time and starts with the issues after I restart said application (or after running it for some time). Well, at least it gives a free ad block:

                Comment


                • #23
                  Originally posted by TAXI View Post
                  (I can't find any reply from Benjamin after that mail: http://lists.freedesktop.org/archive...ne/060663.html ), so I might really do it when I find the time for.
                  In fact it's me
                  I already sent a backtrace to Tapani, offlist.

                  And yes, the first launch works, but not the next launch (when the cache is used).

                  Comment


                  • #24
                    Originally posted by whitecat View Post
                    In fact it's me
                    I already sent a backtrace to Tapani, offlist.

                    And yes, the first launch works, but not the next launch (when the cache is used).
                    Haha, the net is small.
                    Well, I also wrote a mail to Tapani (offlist, to his intel.com address), asking if there's anything I could do to help debugging this. So hopefully it will get fixed soon.

                    Comment


                    • #25
                      of my development environment intact.


                      Comment


                      • #26
                        Any use for this outside of games?


                        Comment

                        Working...
                        X