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
GL_MALI_SHADER_BINARY_ARM solved the problem
glShaderBinary(1, &v, GL_MALI_SHADER_BINARY_ARM, (void*)&VertexShaderArray, sizeof(char)*sizeof(VertexShaderArray));
glShaderBinary(1, &f, GL_MALI_SHADER_BINARY_ARM, (void*)&fragShaderArray, sizeof(char)*sizeof(fragShaderArray));
Hello,
recently I'm trying mali offline shader compiler too but it doesn't work. Have you successfully run a sample case with binary shader compiled by offline compiler? Could you give me some suggestions?
For the binaries compiled with the offline compiler to work, they need to be built for the specific combination of driver version, GPU, and GPU HWREV, or it will not work. This is the most likely cause of them not running on the target platform.
Hth,
Chris