<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Update:<br></div><div><br></div><div>All function with GLclampf and GLfloat are messed up. But pointer are fine. Other datatype works fine as well. I never had such a weird issue before. The work around to replace it with GLdouble.<br></div><div><br></div><div><br></div><div>Yuzhu<br></div><div><br></div><div><br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Yuzhu Lu" <yuzhu@wolfram.com><br><b>To: </b>mesa-dev@lists.freedesktop.org, mesa-users@lists.freedesktop.org<br><b>Sent: </b>Wednesday, August 19, 2015 5:15:46 PM<br><b>Subject: </b>Re: [Mesa-dev] glClearColor is broken in a weird way if compiled with mangling enabled<br><div><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000" data-mce-style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000;"><div>It seems related to datatype GLclampf, which affects mglClearColor, mglBlendColor... If I replace it with double, everything works fine. Any ideas?</div><div><br></div><div><br></div><div><br></div><div>Yuzhu</div><div><br></div><div><br></div><div><br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Yuzhu Lu" <yuzhu@wolfram.com><br><b>To: </b>mesa-dev@lists.freedesktop.org, mesa-users@lists.freedesktop.org<br><b>Sent: </b>Friday, August 14, 2015 1:22:05 PM<br><b>Subject: </b>[Mesa-dev] glClearColor is broken in a weird way if compiled with mangling enabled<br><div><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000" data-mce-style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000;"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000" data-mce-style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000;"><div>Hi All,<br></div><div><br></div><div>Since I need to load osmesa and system GL api at the same time on Linux, I need to compile 10.5.9 osmesa in a mangled way. After a simple fix in glapi.h:<br></div><div><br></div><div>/* Is this needed? It is incomplete anyway. */<br>/*<br>#ifdef USE_MGL_NAMESPACE<br>#define _glapi_set_dispatch _mglapi_set_dispatch<br>#define _glapi_get_dispatch _mglapi_get_dispatch<br>#define _glapi_set_context _mglapi_set_context<br>#define _glapi_get_context _mglapi_get_context<br>#define _glapi_Dispatch _mglapi_Dispatch<br>#define _glapi_Context _mglapi_Context<br>#endif<br>*/</div><div><br></div><div>Now it compiles fine and here is my configuration:<br></div><div><br></div><div>./configure CFLAGS="-O2" CXXFLAGS="-O2" --disable-xvmc --disable-glx --disable-dri --with-dri-drivers="" --with-gallium-drivers="swrast" --enable-texture-float --enable-shared-glapi --disable-egl --enable-mangling --with-egl-platforms="" --enable-gallium-osmesa --enable-gallium-llvm=yes --disable-llvm-shared-libs --with-osmesa-bits=32 --with-max-width=65536 --with-max-height=65536</div><div><br></div><div>But glClearColor is broken in a weird way that the value passed in is revised internally. Here is my call:<br></div><div> mglClearColor(0.5f, 0.3f, 0.3f, 0.3f);</div><div><br></div><div>But if I print out the value in _mesa_ClearColor() method of Clear.c. It shows:<br></div><div>ClearColor: 0.000000, 2.000000, 2.000000, 2.000000<br><div><br></div></div><div>I totally have no idea why this is happening while everything works fine with mangling disabled.<br></div><div><br></div><div>Also, the compiler complains that mglGetString returns int instead of const GLubyte*:<br></div><div>osdemo32.c:441:1: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]<br> printf("Version: %s\n", mglGetString(GL_VERSION));</div><div><br></div><div>And mglGetString(GL_SHADING_LANGUAGE_VERSION) will crash the application while other string works fine.<br></div><div><br></div><div>I also try to compile it with disable-shared-glapi flag, but I get errors. I am not sure this is because gl_mangle.h is dated. (If I manually add the following functions in gl_mangle.h, it compiles fine but some functions like glCreateShader will be totally messed up.)</div><div><br></div><div>I would really appreciate it if someone have solutions because this is a very important project for us. <br></div><div><br></div><div><br></div><div><br></div><div>CXXLD libMangledOSMesa32.la<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x5588): undefined reference to `glPointSizePointerOES'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6ae8): undefined reference to `glPolygonOffsetClampEXT'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6b78): undefined reference to `glAlphaFuncx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6b90): undefined reference to `glClearColorx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6ba8): undefined reference to `glClearDepthx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6bc0): undefined reference to `glColor4x'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6bd8): undefined reference to `glDepthRangex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6bf0): undefined reference to `glFogx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6c08): undefined reference to `glFogxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6c20): undefined reference to `glFrustumf'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6c38): undefined reference to `glFrustumx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6c50): undefined reference to `glLightModelx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6c68): undefined reference to `glLightModelxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6c80): undefined reference to `glLightx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6c98): undefined reference to `glLightxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6cb0): undefined reference to `glLineWidthx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6cc8): undefined reference to `glLoadMatrixx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6ce0): undefined reference to `glMaterialx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6cf8): undefined reference to `glMaterialxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6d10): undefined reference to `glMultMatrixx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6d28): undefined reference to `glMultiTexCoord4x'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6d40): undefined reference to `glNormal3x'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6d58): undefined reference to `glOrthof'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6d70): undefined reference to `glOrthox'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6d88): undefined reference to `glPointSizex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6da0): undefined reference to `glPolygonOffsetx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6db8): undefined reference to `glRotatex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6dd0): undefined reference to `glSampleCoveragex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6de8): undefined reference to `glScalex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6e00): undefined reference to `glTexEnvx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6e18): undefined reference to `glTexEnvxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6e30): undefined reference to `glTexParameterx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6e48): undefined reference to `glTranslatex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6e60): undefined reference to `glClipPlanef'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6e78): undefined reference to `glClipPlanex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6e90): undefined reference to `glGetClipPlanef'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6ea8): undefined reference to `glGetClipPlanex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6ec0): undefined reference to `glGetFixedv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6ed8): undefined reference to `glGetLightxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6ef0): undefined reference to `glGetMaterialxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6f08): undefined reference to `glGetTexEnvxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6f20): undefined reference to `glGetTexParameterxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6f38): undefined reference to `glPointParameterx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6f50): undefined reference to `glPointParameterxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x6f68): undefined reference to `glTexParameterxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9b78): undefined reference to `glAlphaFuncx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9b90): undefined reference to `glClearColorx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9ba8): undefined reference to `glClearDepthx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9bc0): undefined reference to `glColor4x'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9bd8): undefined reference to `glDepthRangex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9bf0): undefined reference to `glFogx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9c08): undefined reference to `glFogxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9c20): undefined reference to `glFrustumf'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9c38): undefined reference to `glFrustumx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9c50): undefined reference to `glLightModelx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9c68): undefined reference to `glLightModelxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9c80): undefined reference to `glLightx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9c98): undefined reference to `glLightxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9cb0): undefined reference to `glLineWidthx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9cc8): undefined reference to `glLoadMatrixx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9ce0): undefined reference to `glMaterialx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9cf8): undefined reference to `glMaterialxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9d10): undefined reference to `glMultMatrixx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9d28): undefined reference to `glMultiTexCoord4x'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9d40): undefined reference to `glNormal3x'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9d58): undefined reference to `glOrthof'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9d70): undefined reference to `glOrthox'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9d88): undefined reference to `glPointSizex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9da0): undefined reference to `glPolygonOffsetx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9db8): undefined reference to `glRotatex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9dd0): undefined reference to `glSampleCoveragex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9de8): undefined reference to `glScalex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9e00): undefined reference to `glTexEnvx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9e18): undefined reference to `glTexEnvxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9e30): undefined reference to `glTexParameterx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9e48): undefined reference to `glTranslatex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9e60): undefined reference to `glClipPlanef'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9e78): undefined reference to `glClipPlanex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9e90): undefined reference to `glGetClipPlanef'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9ea8): undefined reference to `glGetClipPlanex'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9ec0): undefined reference to `glGetFixedv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9ed8): undefined reference to `glGetLightxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9ef0): undefined reference to `glGetMaterialxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9f08): undefined reference to `glGetTexEnvxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9f20): undefined reference to `glGetTexParameterxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9f38): undefined reference to `glPointParameterx'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9f50): undefined reference to `glPointParameterxv'<br>../../../../src/mapi/glapi/.libs/libglapi.a(glapi_libglapi_la-glapi_getproc.o):(.data.rel.ro+0x9f68): undefined reference to `glTexParameterxv'<br>collect2: error: ld returned 1 exit status<br><div><br></div></div><div><br></div><div><br></div><div>Yuzhu Lu<br></div><div>Senior User Interface Developer<br></div><div>Wolfram Research Inc.<br></div><div><br></div></div></div><div><br></div></div><br>_______________________________________________<br>mesa-dev mailing list<br>mesa-dev@lists.freedesktop.org<br>http://lists.freedesktop.org/mailman/listinfo/mesa-dev<br></div><div><br></div></div><br>_______________________________________________<br>mesa-dev mailing list<br>mesa-dev@lists.freedesktop.org<br>http://lists.freedesktop.org/mailman/listinfo/mesa-dev<br></div><div><br></div></div></body></html>