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

Filippo Argiolas filippo.argiolas at gmail.com
Sat Nov 29 20:33:15 CET 2008


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




More information about the gstreamer-devel mailing list