osmesa-llvmpipe on sparcv9 (big endian)?

Takuya OSHIMA <[email protected]>
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <[email protected]>
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

_______________________________________________
mesa-users mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-users
test-sparcv9-legacy.png (image/png, 19 KB) - not displayed
test-sparcv9-llvm-2103.png (image/png, 7.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.