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

Brian Paul brianp at vmware.com
Mon Mar 23 07:53:29 PDT 2015


On 03/22/2015 12:57 AM, Takuya OSHIMA wrote:
> Hi,
>
> I am trying to get a scientific visualization software called ParaView
> (http://www.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.

Hard to say with out more details.


> 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 fromhttp://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.

You may be the first person to every try llvmpip on a SPARC processor. 
AFAIK, none of us who wrote the driver have tried it.  I know we rely on 
x86/sse intrinsic functions in a few places and I'm not sure what will 
happen with those paths on non-x86.  I'm afraid I don't have any spare 
time to look closer.

>
> 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");
> }

May be a big/little endian issue, but hard to say.

-Brian




More information about the mesa-users mailing list