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

Mali offline compiled shaders using in OpenGLES2.0 Application

Dear All,

I am using Mali-400 GPU.

I want to use the Mali off-line shader compiler, to compile the Vertex shader and Fragment shaders.

Can some one please post the example code for using off-line compiled shaders in a OpenGLES2.0 application.

I have compiled my  Vertex shader  and Fragment shader using ARM Mali off-line compiler with below step

>malisc.exe --vertex -c Mali-400 -r r1p1 -d Mali-400_r5p0-01rel0 Vertex_shader.glsl -o vshader.out

>malisc.exe --fragment -c Mali-400 -r r1p1 -d Mali-400_r5p0-01rel0 Fragm_shader.glsl -o fragment.out

I am using below like code,

my application compiles successfully, but application not running on my target. copied the shader binaries content into a static array and usign that with glShaderBinary.

............................................

char VertexShaderArray[] = {<initialized using shader binary data>};

char fragShaderArray[] = {<initialized using shader binary data>};

GLuint v, f, program;

v = glCreateShader(GL_VERTEX_SHADER);

f = glCreateShader(GL_FRAGMENT_SHADER);

glShaderBinary(1, &v, 0x0, (void*)&VertexShaderArray, sizeof(char)*sizeof(VertexShaderArray));

glShaderBinary(1, &f, 0x0, (void*)&fragShaderArray, sizeof(char)*sizeof(fragShaderArray));

program = glCreateProgram();

glAttachShader(program, v);

glAttachShader(program, f);

glLinkProgram(program);

glUseProgram(program);

.........................................

I am getting a message on my target while running this application:

info: L0101 All attached shaders must be compiled prior to linking

Thanks,

Ravinder Are