1

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

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.

my code snippet:

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, MALI_PROGRAM_BINARY_ARM, (void*)&VertexShaderArray, sizeof(char)*sizeof(VertexShaderArray));
glShaderBinary(1, &f, MALI_PROGRAM_BINARY_ARM, (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

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

user279505
  • 129
  • 2
  • 6
  • Can you grab the shader info logs? That might reveal something. Otherwise all ARM seems to say is that "Linking only fails if the uniform or varying variables of the shaders are incompatible.", which doesn't seem to be directly applicable. – Tommy Apr 15 '16 at 14:34

0 Answers0