<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:eero.t.tamminen@intel.com" title="Eero Tamminen <eero.t.tamminen@intel.com>"> <span class="fn">Eero Tamminen</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [regression] WebGL demo iamnop.com/particles is very slow and spends far too long compiling shaders"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=97035">bug 97035</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">See Also</td>
           <td>
                
           </td>
           <td>https://bugs.freedesktop.org/show_bug.cgi?id=91857
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [regression] WebGL demo iamnop.com/particles is very slow and spends far too long compiling shaders"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=97035#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [regression] WebGL demo iamnop.com/particles is very slow and spends far too long compiling shaders"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=97035">bug 97035</a>
              from <span class="vcard"><a class="email" href="mailto:eero.t.tamminen@intel.com" title="Eero Tamminen <eero.t.tamminen@intel.com>"> <span class="fn">Eero Tamminen</span></a>
</span></b>
        <pre>Tested this on SKL GT2 with today's Mesa.

All the other shapes selectable in the WebGL demo load instantly and run well
over 60FPS.  However, selecting the default "galaxy" shape takes ~20s and runs
at ~2FPS.

Problem is couple of shaders that get compiled, Mesa spills with them and as
result they're huge.  I've attached cleaned up versions of the shaders
(indented then & replaced hex hash names with something shorter).

OGL_PS_0016.glsl is the main culprit, Mesa produces 800KB shader assembly file
with ~8000 instructions for it.  According to 'perf', compile time goes to:
-------------------------------
# Cost  Object        Symbol
27.14%  i965_dri.so   ra_allocate                                              
19.94%  i965_dri.so   fs_visitor::virtual_grf_interferes                       
13.90%  i965_dri.so   ra_add_node_adjacency                                    
10.21%  i965_dri.so   fs_visitor::assign_regs                                  
 4.11%  i965_dri.so   decrement_q.isra.2                                       
 3.83%  i965_dri.so   instruction_scheduler::add_dep                           
 2.97%  i965_dri.so   ra_add_node_interference                                 
 1.71%  libc-2.23.so  _int_malloc
-------------------------------

While OGL_PS_0031.glsl also spills and is in instruction count nearly half of
the previous shader, it compiles and runs >10x faster.  Its 'perf' profile
looks completely different:
-------------------------------
# Cost  Object        Symbol
17.66%  i965_dri.so   (anon)::ir_copy_propagation_visitor::visit
17.12%  i965_dri.so   (anon)::ir_copy_propagation_elements_visitor::kill
12.46%  i965_dri.so   (anon)::ir_copy_propagation_visitor::kill
12.14%  i965_dri.so  
(anon)::ir_copy_propagation_elements_visitor::handle_rvalue
 4.47%  i965_dri.so   ra_allocate
 3.12%  i965_dri.so   ir_expression::accept
 2.66%  i965_dri.so   fs_visitor::virtual_grf_interferes
 1.61%  i965_dri.so   ra_add_node_adjacency
 1.39%  i965_dri.so   fs_visitor::assign_regs
-------------------------------</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>