<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Implement a NIR -> vec4 pass"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89580#c15">Comment # 15</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Implement a NIR -> vec4 pass"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89580">bug 89580</a>
              from <span class="vcard"><a class="email" href="mailto:jason@jlekstrand.net" title="Jason Ekstrand <jason@jlekstrand.net>"> <span class="fn">Jason Ekstrand</span></a>
</span></b>
        <pre>(In reply to Eduardo Lima Mitev from <a href="show_bug.cgi?id=89580#c14">comment #14</a>)
<span class="quote">> (In reply to Kenneth Graunke from <a href="show_bug.cgi?id=89580#c13">comment #13</a>)
> > Yeah, that definitely looks bizarre - but I think it's expected.
> > 
> > Fixed-function vertex programs and ARB programs go through prog_to_nir.c
> > (the Mesa IR -> NIR translator), which generates load_uniform intrinsics
> > directly, instead of creating uniform variables then having nir_lower_io
> > lower variable access to intrinsics.  It just sets nir->num_uniforms
> > directly, and brw_nir.c skips the part that inspects uniform variables when
> > dealing with FF/ARB programs.
> > 
> >    /* Set the number of uniforms */
> >    shader->num_uniforms = 4 * c->prog->Parameters->NumParameters;
> > 

> Thanks Jason and Kenneth! I managed to fix my implementation based on your
> comments.

> Just for the sake of clarity, I wonder if it is worth "fixing" the
> inconsistency in nir_shader for these cases, perhaps injecting the missing
> declarations or something like that. Dunno, probably not.</span >

I don't think so.  I think what we want is a longer-term fix that provides some
way to declare in the nir_shader what uniform ranges get used and what to do
with them.  Unfortunately, that's kind of ill-defined at the moment.  I'm
hoping to get around to making it better-defined soon.</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>