[Mesa-dev] [Bug 89068] glTexImage2D regression by texstore_rgba switch to _mesa_format_convert

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Feb 10 11:33:35 PST 2015


            Bug ID: 89068
           Summary: glTexImage2D regression by texstore_rgba switch to
           Product: Mesa
           Version: git
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: brad.king at kitware.com
        QA Contact: mesa-dev at lists.freedesktop.org

VTK's nightly testing regressed due to a mesa update that bisects to:

commit 8ec6534b266549cdc2798e2523bf6753924f6cde
Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Wed Oct 15 13:42:11 2014 +0200

    mesa: Use _mesa_format_convert to implement texstore_rgba.

    Notice that _mesa_format_convert does not handle byte-swapping scenarios,
    GL_COLOR_INDEX or MESA_FORMAT_YCBCR(_REV), so these must be handled

    Also, remove all the code that goes unused after using

    Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

The call in question from VTK is:

           glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8,
                         imageMemorySize[0], imageMemorySize[1],
                         0, GL_RGBA, GL_UNSIGNED_SHORT,
                         static_cast<unsigned short *>(image) );

Unfortunately I do not have a deep understanding of the relevant code in VTK or
Mesa.  I will attach example test outputs from before and after the change. 
Somehow the background color tints the foreground image.

In texstore_rgba, the code path taken prior to this change was:

   } else if (_mesa_get_format_max_bits(dstFormat) <= 8 &&
              !_mesa_is_format_signed(dstFormat)) {
      return store_ubyte_texture(ctx, dims, baseInternalFormat,
                                 dstRowStride, dstSlices,
                                 srcWidth, srcHeight, srcDepth,
                                 srcFormat, srcType, srcAddr, srcPacking);

and later in _mesa_pack_ubyte_rgba_rect:

   if (srcRowStride == width * 4 * sizeof(GLubyte) &&
       dstRowStride == _mesa_format_row_stride(format, width)) {
      /* do whole image at once */
      _mesa_pack_ubyte_rgba_row(format, width * height,
                                (const GLubyte (*)[4]) src, dst);

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.

You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150210/7b9b0d7b/attachment.html>

More information about the mesa-dev mailing list