Hi,
can somebody help me to verify an bug in ati driver?
The problem is that setting a uniform float value in a GLSL shader produce random values if multiply this float width 2^x values and assign to a vec.
Examples:
uniform float = 1.0 (setting in C Code or in RenderMonkey as uniform variable, Code or RenderMonkey project see last lines)
/* this Code produce a black image!!! (Should be a red) test is (0.0, 0.0)!!!
uniform float testFloat;
void main(void)
{
vec2 test = vec2(2.0*testFloat, 0.0);
gl_FragColor.rg = test;
gl_FragColor.ba = vec2(0.0, 0.0);
}
// this a black image (4.0 is 2^X)
uniform float testFloat;
void main(void)
{
vec2 test = vec2(4.0*testFloat, 0.0);
gl_FragColor.rg = test;
gl_FragColor.ba = vec2(0.0, 0.0);
}
// this Code produce a red image (3.0 is no 2^X)
uniform float testFloat;
void main(void)
{
vec2 test = vec2(3.0*testFloat, 0.0);
gl_FragColor.rg = test;
gl_FragColor.ba = vec2(0.0, 0.0);
}
// this produce red image too , OK
uniform float testFloat;
void main(void)
{
gl_FragColor.r = 2.0 * testFloat;
gl_FragColor.gba = vec3(0.0, 0.0, 0.0);
}
Tested width Radeon X1900, 9800 pro, 9600.
But only the X1900XT shows this bug.
Here is the Ati Render Monkey project:
http://www.fbihome.de/~dacri/UniformAtiGLSLBug.rfx
Here a Visual Studio 6.0 project (glut and glew included, 2,7 meg)
http://fbihome.de/~dacri/UniformAtiGLSLBug.rar
And here only the cpp file.
http://fbihome.de/~dacri/FBO_MRTTest.cpp