I've encountered what I believe is a bug in Mesa3d when setting vertex attributes, it seems that glVertexAttrib1dARB (double precision) works but glVertexAttrib1fARB (float precision) doesn't. The same applies for glVertexAttribPointerARB, but with GL_DOUBLE and GL_FLOAT. This bug might only affect generic vertex attributes (greater than or equal to 8) since glNormalPointer seems to work fine. I've attached a simple demo program modified from a demo program in Mesa3d. See the main() function. The demo just tests vertex attributes, not glNormalPointer; I confirmed this works in another program. I am using Mesa3d, libdrm, and drm from the latest CVS/Git with the r300 driver.
Created attachment 7075 [details] Vertex attribute bug test program.
Not a bug. If you compile with warning flags (such as -Wall -Wmissing-prototypes -g -ansi -pedantic) you'll see a bunch of warnings such as: attribbug.c:136: warning: implicit declaration of function `glVertexAttrib1dARB' attribbug.c:141: warning: implicit declaration of function `glVertexAttrib1fARB' To fix that, add #define GL_GLEXT_PROTOTYPES before you #include GL/gl.h Without prototypes, the compiler is passing an 8-byte double to glVertexAttrib1fARB() which becomes an invalid value inside Mesa since it's expecting a 4-byte float. When using C/C++ you should always use as many compiler warning options as possible.
(In reply to comment #2) > Not a bug. > > If you compile with warning flags (such as -Wall -Wmissing-prototypes -g -ansi > -pedantic) you'll see a bunch of warnings such as: > > attribbug.c:136: warning: implicit declaration of function `glVertexAttrib1dARB' > attribbug.c:141: warning: implicit declaration of function `glVertexAttrib1fARB' > > To fix that, add #define GL_GLEXT_PROTOTYPES before you #include GL/gl.h > > Without prototypes, the compiler is passing an 8-byte double to > glVertexAttrib1fARB() which becomes an invalid value inside Mesa since it's > expecting a 4-byte float. > > When using C/C++ you should always use as many compiler warning options as possible. > Oh, I didn't realize that I'd forgotten -Wall. Thanks for pointing that out.
(In reply to comment #3) > (In reply to comment #2) > > Not a bug. > > > > If you compile with warning flags (such as -Wall -Wmissing-prototypes -g -ansi > > -pedantic) you'll see a bunch of warnings such as: > > > > attribbug.c:136: warning: implicit declaration of function `glVertexAttrib1dARB' > > attribbug.c:141: warning: implicit declaration of function `glVertexAttrib1fARB' > > > > To fix that, add #define GL_GLEXT_PROTOTYPES before you #include GL/gl.h > > > > Without prototypes, the compiler is passing an 8-byte double to > > glVertexAttrib1fARB() which becomes an invalid value inside Mesa since it's > > expecting a 4-byte float. > > > > When using C/C++ you should always use as many compiler warning options as > possible. > > > > Oh, I didn't realize that I'd forgotten -Wall. Thanks for pointing that out. > (In reply to comment #2) > Not a bug. > > If you compile with warning flags (such as -Wall -Wmissing-prototypes -g -ansi > -pedantic) you'll see a bunch of warnings such as: > > attribbug.c:136: warning: implicit declaration of function `glVertexAttrib1dARB' > attribbug.c:141: warning: implicit declaration of function `glVertexAttrib1fARB' > > To fix that, add #define GL_GLEXT_PROTOTYPES before you #include GL/gl.h > > Without prototypes, the compiler is passing an 8-byte double to > glVertexAttrib1fARB() which becomes an invalid value inside Mesa since it's > expecting a 4-byte float. > > When using C/C++ you should always use as many compiler warning options as possible. > I had seen those messages, where is a programmer supposed to find this out from other than this bug?
Mass version move, cvs -> git
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.