| Summary: | glVertexAttrib1dARB (double) behaves correctly, but glVertexAttrib1fARB (float) does not. | ||
|---|---|---|---|
| Product: | Mesa | Reporter: | Oliver McFadden <z3ro.geek> |
| Component: | Mesa core | Assignee: | mesa-dev |
| Status: | RESOLVED NOTABUG | QA Contact: | |
| Severity: | normal | ||
| Priority: | high | CC: | glisse |
| Version: | git | ||
| Hardware: | x86 (IA32) | ||
| OS: | Linux (All) | ||
| URL: | http://z3ro.name/attribbug.c | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
| Attachments: | Vertex attribute bug test program. | ||
|
Description
Oliver McFadden
2006-09-19 08:51:07 UTC
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.