<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - glTexImage2D regression by texstore_rgba switch to _mesa_format_convert"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89068#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - glTexImage2D regression by texstore_rgba switch to _mesa_format_convert"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89068">bug 89068</a>
              from <span class="vcard"><a class="email" href="mailto:itoral@igalia.com" title="Iago Toral <itoral@igalia.com>"> <span class="fn">Iago Toral</span></a>
</span></b>
        <pre>(In reply to Iago Toral from <a href="show_bug.cgi?id=89068#c4">comment #4</a>)
<span class="quote">> (In reply to Brad King from <a href="show_bug.cgi?id=89068#c0">comment #0</a>)
> (...)
> > After the change, _mesa_format_convert is called but none of the coe paths
> > invoking _mesa_pack_ubyte_rgba_row is taken.  Instead the path using
> > compute_src2dst_component_mapping is taken and the result is different.</span >

The kind of effect you get looks as if you were getting alpha values < 1.0
after the texture upload and then blending against the background. If the
texture has a solid alpha channel that should not happen..., however, I wrote a
small program to do this same kind of texture upload and it works fine for me,
it only blends against the background if I pass alpha values < 65535 in the
input, otherwise it won't blend, which is the expected behavior... so I am not
sure about what is going on in your case.

For reference, this is the output I get in a GDB session for that texture
upload (on an Intel GPU):

<span class="quote">> Brad, it would be super helpful for me to understand what is going on if you
> could run a gdb session and print:

> a) the values of the parameters passed to compute_src2dst_component_mapping
> _after_ it has been called (they all are 4-element arrays, the last one is
> an out parameter so that is why I need the values after the call has been
> done)</span >

(gdb) p src2rgba
$1 = "\000\001\002\003"
(gdb) p rgba2dst
$2 = "\000\001\002\003"
(gdb) p rebase_swizzle
$3 = (uint8_t *) 0x0
(gdb) p src2dst
$4 = "\000\001\002\003"

These are the expected values for my Intel hardware.

<span class="quote">> b) The following input parameters for the call to _mesa_swizzle_and_convert
> right after: src_type, dst_type, dst_num_channels, src_num_channels,
> normalized, width.</span >

(gdb) p src_type
$5 = MESA_ARRAY_FORMAT_TYPE_USHORT
(gdb) p src_num_channels
$6 = 4
(gdb) p dst_type
$7 = MESA_ARRAY_FORMAT_TYPE_UBYTE
(gdb) p dst_num_channels
$8 = 4
(gdb) p normalized
$9 = true

Again, these are the expected values.

<span class="quote">> Could you do this?</span >

And also, what GPU are you running on?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>