[gst-devel] ATI + GLSL + setlocale + linux

Julien Isorce julien.isorce at gmail.com
Sat Nov 29 21:30:14 CET 2008


Hi Filippo,

Yup and it seems it was present in NVIDIA some years ago, but fixed now.

Anyway the bug is strange because even I tried to call setlocale(LC_NUMERIC,
"C"); before compiling the shader and linking, and then restore by calling
setlocale(LC_NUMERIC, "");, it still does not work.
I thinking the problem happens at runtime, and not when parsing shader
(because no error report in the ati shader compiler log).
Maybe the compiled shader is not understandable when it was parsed with
locale "".

If I call setlocale(LC_NUMERIC, "C"); in gstopengl.c, then the sharder works
:P (Do you remember  the pb about "purple" result ? now I can see the right
colors with this ATI card)

Is it a problem to never restore to "" ?

I am going to report the pb to the ATI Developer Support.

Sincerely

Julien



2008/11/29 Filippo Argiolas <filippo.argiolas at gmail.com>

> On Sat, Nov 29, 2008 at 4:05 PM, Julien Isorce <julien.isorce at gmail.com>
> wrote:
> > Hi,
> Hi Julien,
>
> > ./test 0   give the wrong result:  red color in the window. ( setlocale
> > (LC_ALL, "");  is called)
> > ./test 1   give the right result:  yellow color in the window. (
> setlocale
> > (LC_ALL, "C"); is called)
>
> It seems that the ATI GLSL Compiler does some kind of localized string
> parsing on the shader source.  When you call setlocale (LC_ALL, NULL)
> it just sets the french locale, where the decimal separator is the ","
> character. In "C" locale the decimal separator is the "." character.
>
> So the decimal part of the floats in the shader source is truncated
> because dot is not interpreted as decimal separator.
> >From your testcase:
> gl_FragColor = vec4(1.0, 0.9, 0.1, 1.0); is yellow on a C/english
> locale but becomes something like vec4(1, 0, 0, 1) (red) or like
> vec4(1,0, 0,9, 0,1, 1,0) (red with alpha=9) on a French locale.
>
> I don't know what could cause such a behaviour but I guess it's an ATI
> compiler bug. You should report it to their Developer Support, quoting
> from  http://developer.amd.com/support/Pages/default.aspx :
> "For all GPU-related developer inquiries, email devrel at ati.com with
> the subject line "GPU-Developer-Support""
>
> Best Regards,
>
> Filippo Argiolas
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20081129/b022a302/attachment.htm>


More information about the gstreamer-devel mailing list