This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

The mathmatic computing result in Shader is not right for Mali 400mp

I'm using Mali 400mp for doing some mathmetic computing.But the result is not satisfying.

In my program, I put a float array A by using gluniforlfv() into the shader,and put a Image Texture B by using glTexImage2D() into the shader,use the values in A and values in B to do mathmatic computing.

I use Mali's parameter to se OpenGL ES2.0 environment:

    protected int redSize = 8;

    protected int greenSize = 8;

    protected int blueSize = 8;

    protected int alphaSize = 8;

    protected int depthSize = 16;

    protected int sampleSize = 4;

    protected int stencilSize = 0;

The txture parameter is:

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

      ........

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,  texwidth, texheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, Data);

The problem is :

Firstly, when I use gluniformlfv() to put a float array into the shader, the value in shader for computing is not the same as its real value.For example, if the value is 0.123456, however, in shader, the value is bigger or smaller in fact .So as other values.

Secondly, When I doing some computing in shader, it seems the result is not right for addition ,division etc. The result has some difference with the idealized mathmatic computing. I don't know why.