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

Takuya OSHIMA oshima at eng.niigata-u.ac.jp
Wed Mar 25 19:47:48 PDT 2015


Brian, thanks for your reply and sorry about the missing details. I am
still new to Mesa and LLVM codes and was unsure what was the curucial
information.

Trying to understand your comment about the use of the intrinsic
functions, I simply ran a "grep -r intrinsic ."  at the top of the
Mesa source tree. Probably I found what you ment by the code paths for
non-x86/sse cpus under src/gallium/auxiliary/gallivm/lp_bld_*.c, the
paths after the "if(intrinsic) { ... return ...; }" section in each
function. I think I can check the paths one by one by running the same
test case on an x86 system (which has been confirmed to work) and
comparing each other.

Takuya OSHIMA, Ph.D.
Faculty of Engineering, Niigata University
8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN

From: Brian Paul <brianp at vmware.com>
Subject: Re: [Mesa-users] osmesa-llvmpipe on sparcv9 (big endian)?
Date: Mon, 23 Mar 2015 08:53:29 -0600

> 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