<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Ahh. You are righ. That fixes it.<br></div><div><br></div><div><br></div><div>Yuzhu<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>"Brian Paul" <brianp@vmware.com><br><b>To: </b>"Yuzhu Lu" <yuzhu@wolfram.com><br><b>Cc: </b>mesa-dev@lists.freedesktop.org, mesa-users@lists.freedesktop.org<br><b>Sent: </b>Monday, August 24, 2015 8:00:52 PM<br><b>Subject: </b>Re: [Mesa-users] [Mesa-dev] glClearColor is broken in a weird way if compiled with mangling enabled<br><div><br></div><br>Looks like your code is not finding any mgl*() prototypes.  What <br>#includes do you have?  I think you need to #include "GL/gl_mangle.h" <br>and then "GL/gl.h", IIRC.<br><div><br></div>-Brian<br><div><br></div>On 08/24/2015 11:42 AM, Yuzhu Lu wrote:<br>> Sorry.<br>><br>> Here it is:<br>><br>> osboxes@osboxes:~/Documents/mesa-demos-8.2.0/src/osdemos$ gcc -o<br>> osdemo32 osdemo32.c -I/usr/local/include/<br>> -I/home/osboxes/Documents/mesa-demos-8.2.0/src/util/ -L/usr/local/lib/<br>> -lMangledOSMesa32<br>> osdemo32.c: In function ‘Init’:<br>> osdemo32.c:122:32: warning: cast to pointer from integer of different<br>> size [-Wint-to-pointer-cast]<br>> printf("GL_RENDERER = %s\n",(const char *) mglGetString(GL_RENDERER));<br>> ^<br>> osdemo32.c: In function ‘main’:<br>> osdemo32.c:449:1: warning: format ‘%s’ expects argument of type ‘char<br>> *’, but argument 2 has type ‘int’ [-Wformat=]<br>> printf("Vendor: %s\n", mglGetString(GL_VENDOR));<br>> ^<br>> osdemo32.c:450:1: warning: format ‘%s’ expects argument of type ‘char<br>> *’, but argument 2 has type ‘int’ [-Wformat=]<br>> printf("Renderer: %s\n", mglGetString(GL_RENDERER));<br>> ^<br>> osdemo32.c:451:1: warning: format ‘%s’ expects argument of type ‘char<br>> *’, but argument 2 has type ‘int’ [-Wformat=]<br>> printf("Version: %s\n", mglGetString(GL_VERSION));<br>> ^<br>> osdemo32.c:452:46: warning: cast to pointer from integer of different<br>> size [-Wint-to-pointer-cast]<br>> printf("GL_PROGRAM_ERROR_STRING_ARB: = %s\n",(const char<br>> *)mglGetString(GL_PROGRAM_ERROR_STRING_ARB));<br>><br>><br>><br>> Yuzhu<br>><br>> ------------------------------------------------------------------------<br>> *From: *"Brian Paul" <brianp@vmware.com><br>> *To: *"Yuzhu Lu" <yuzhu@wolfram.com><br>> *Cc: *mesa-dev@lists.freedesktop.org, mesa-users@lists.freedesktop.org<br>> *Sent: *Monday, August 24, 2015 6:07:19 PM<br>> *Subject: *Re: [Mesa-users] [Mesa-dev] glClearColor is broken in a weird<br>> way if compiled with mangling enabled<br>><br>> On 08/24/2015 10:51 AM, Yuzhu Lu wrote:<br>>  > Hi Brian,<br>>  ><br>>  > It happens for all the configuration I tried. Here is one example:<br>>  ><br>>  > ./configure --disable-xvmc --disable-glx --disable-dri<br>>  > --with-dri-drivers="" --with-gallium-drivers="swrast"<br>>  > --enable-texture-float --enable-shared-glapi --disable-egl<br>>  > --enable-mangling --with-egl-platforms="" --enable-gallium-osmesa<br>>  > --enable-gallium-llvm=yes --disable-llvm-shared-libs<br>>  ><br>>  > I am not sure this is related. I am using 64bit Ubuntu.<br>>  ><br>>  > Here are the only warnings I get:<br>>  ><br>>  > nir/glsl_to_nir.cpp: In member function 'virtual void<br>>  > {anonymous}::nir_visitor::visit(ir_call*)':<br>>  > nir/glsl_to_nir.cpp:610:73: warning: 'op' may be used uninitialized in<br>>  > this function [-Wmaybe-uninitialized]<br>>  > nir_intrinsic_instr *instr = nir_intrinsic_instr_create(shader, op);<br>>  ><br>>  > nir/nir_lower_phis_to_scalar.c: In function 'is_phi_src_scalarizable':<br>>  > nir/nir_lower_phis_to_scalar.c:70:14: warning: 'or' of unmatched<br>>  > not-equal tests is always 1<br>>  > src_alu->op != nir_op_vec4;<br>>  > ^<br>>  > CXX nir/nir_lower_samplers.lo<br>>  > nir/nir_lower_samplers.cpp: In function 'void<br>>  > lower_sampler(nir_tex_instr*, gl_shader_program*, const gl_program*,<br>>  > void*)':<br>>  > nir/nir_lower_samplers.cpp:72:9: warning: unused variable 'has_indirect'<br>>  > [-Wunused-variable]<br>>  > bool has_indirect = false;<br>><br>> I was asking about the compiler options/warnings when you compile your<br>> mgl application, not Mesa itself.<br>><br>> -Brian<br>><br>><br>><br><div><br></div></div><div><br></div></div></body></html>