[Mesa-users] osmesa-llvmpipe on sparcv9 (big endian)?

Takuya OSHIMA oshima at eng.niigata-u.ac.jp
Sat Mar 21 23:57:02 PDT 2015


Hi,

I am trying to get a scientific visualization software called ParaView
(http://paraview.org/) working with osmesa-llvmpipe on a GPU-less
sparcv9 Linux system (ParaView-4.3.1, Mesa-10.5.1, LLVM-3.6.0).

When OSMesa is built without LLVM, everything works fine as shown by
the attached color render of a sphere (test-sparcv9-legacy.png).

However, with LLVM, ParaView crashes with an "Invalid array format"
message from src/mesa/main/formats.c:_mesa_array_format_flip_channels()
(which I guess flips color channels for big endian systems) with
num_channels == 3.

I tried adding an if-statement for num_channels == 3 (shown below)
with all possible swizzle arrangements (4! = 24 combinations) without
success: I do get a rendered image but with miscomposed color
channels, e.g. attached test-sparcv9-llvm-2103.png (the 2-1-0-3 is the
swizzle order of this image).

I am aware from http://www.mesa3d.org/llvmpipe.html that llvmpipe is
only supported for x86-based systems, but it does not look so far from
getting a correct rendering. Any comments and suggestions are
appreciated.

mesa_array_format
_mesa_array_format_flip_channels(mesa_array_format format)
{
   int num_channels;
   uint8_t swizzle[4];

   num_channels = _mesa_array_format_get_num_channels(format);
   _mesa_array_format_get_swizzle(format, swizzle);

   if (num_channels == 1)
      return format;

   if (num_channels == 2) {
      _mesa_array_format_set_swizzle(&format, swizzle[1], swizzle[0],
                                     swizzle[2], swizzle[3]);
      return format;
   }

   // The following if-statement is my addition
   if (num_channels == 3) {
      _mesa_array_format_set_swizzle(&format, swizzle[2], swizzle[1],
                                     swizzle[0], swizzle[3]);
      return format;
   }

   if (num_channels == 4) {
      _mesa_array_format_set_swizzle(&format, swizzle[3], swizzle[2],
                                     swizzle[1], swizzle[0]);
      return format;
   }

   unreachable("Invalid array format");
}

Takuya OSHIMA, Ph.D.
Faculty of Engineering, Niigata University
8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-sparcv9-legacy.png
Type: image/png
Size: 19450 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-users/attachments/20150322/2545b5fa/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-sparcv9-llvm-2103.png
Type: image/png
Size: 7698 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-users/attachments/20150322/2545b5fa/attachment-0003.png>


More information about the mesa-users mailing list