I'm trying to get OpenGL ES hardware acceleration set up on my Samsung ARM Chromebook running Linux. I followed the instructions on the Mali Developer page to get the Mali driver installed by maybe I did something wrong.
When I try to run es2tri from the Mesa demos I get the following error:
root@localhost:~/gles2# ./es2tri [PLUGIN INFO] Plugin initializing [PLUGIN DEBUG] './override.instr_config' not found, trying to open the process config file [PLUGIN DEBUG] './es2tri.instr_config' not found, trying to open the default config file [PLUGIN ERROR] Couldn't open default config file './default.instr_config'. [PLUGIN INFO] No configuration file found, attempting to use environment [PLUGIN INFO] CINSTR GENERAL: Output directory set to: . [PLUGIN INFO] No instrumentation features requested. EGL_VERSION = 1.4 Midgard-"r3p0-02rel0" EGL_VENDOR = ARM EGL_EXTENSIONS = EGL_KHR_config_attribs EGL_KHR_image EGL_KHR_image_base EGL_KHR_fence_sync EGL_KHR_wait_sync EGL_ARM_pixmap_multisample_discard EGL_KHR_gl_texture_2D_image EGL_KHR_gl_renderbuffer_image EGL_KHR_create_context EGL_KHR_surfaceless_context EGL_KHR_gl_texture_cubemap_image EGL_KHR_image_pixmap EGL_CLIENT_APIS = OpenGL_ES Error: fragment shader did not compile!
The fragment shader program:
static const char *fragShaderText = "varying vec4 v_color;\n" "void main() {\n" " gl_FragColor = v_color;\n" "}\n";
How it's being used:
GLuint fragShader, vertShader, program; GLint stat; fragShader = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fragShader, 1, (const char **) &fragShaderText, NULL); glCompileShader(fragShader); glGetShaderiv(fragShader, GL_COMPILE_STATUS, &stat); if (!stat) { printf("Error: fragment shader did not compile!\n"); exit(1); }
When I run the application using the Mesa GLES drivers, everything works. When I run linking to the Mali drivers, there's that error. Other Mesa demo applications es2gears run ok and much faster on Mali than the Mesa drivers.
You can see the full es2tri.c source code here:
mesa/demos - A collection of OpenGL / Mesa demos and test programs.
Hopefully I provided enough information for people to help me understand what's wrong. Sorry if this isn't the right place for this question. Thanks.
It's probably since you aren't having a default precision set for floats.
slap a 'precision highp float;' at the top of your pixel shader to see if it'll work.
You should modify inside the if statement to get a info log as well, this log will tell you why it didn't compile.
GLsizei length;
GLchar log[1024];
glGetShaderInfoLog(fragShader, 1024, &length, log);
printf("log: '%s'\n", log);
Thanks, there's actually precision declarations in the Mali SDK sample fragment shaders. I didn't realize those were required and assumed the Mesa code to be complete. Plus, i was thinking I missed something in one of those driver setup instructions.